Sorting lines by variable directions and types

James Hurley jhurley0305 at
Sun Jun 27 23:57:29 EDT 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  
and type.

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


Jim Hurley

More information about the Use-livecode mailing list