Sorting lines by variable directions and types
jhurley0305 at sbcglobal.net
Sun Jun 27 22:57:29 CDT 2010
I have a table in which some columns are text and some are numbers
I would like to assign values to the variables tDirection and tType so
that I could do something like:
put "descending" into tDirection
put "text" into tType
put field 1 into tList
sort lines of tList tDirection tType by word 1 of each
But Rev balks at the variables tDirection and tType. It wants the
explicit words "ascending" , "descending" "text" or "numeric"
I can get around this by using multiple conditionals (If tDirection is
"ascending" then sort lines of tList ascending......."
But this is a little cumbersome since there are 4 pairs of direction
Is there some slight of hand I can perform on the variables tDirection
and tType to make my one-liner functional, i.e.
sort lines of tList MagicOperator(tDirection)
MagicOperator(tType) by word 1 of each
More information about the use-livecode