Identifying variables

Dar Scott dsc at
Wed May 14 12:56:01 EDT 2003

On Wednesday, May 14, 2003, at 11:20 AM, Barry Levine wrote:

> I have three variables - let's use A, B, and C - that contain whole 
> numbers anywhere from 0 to 5; it is probably that at least two of the 
> vars will contain identical numbers. I sort them descending using:
> put A,B,C into theVars
> sort items of theVars desending numeric
> Now the three vars can be in any order. How do I know which var is now 
> first in the order?

Here are three things to try:

Append the name to the digit and sort that.  (if the numbers are 
actually greater than a single digit then format them fixed length.)

Create lines of pairs and sort lines with a custom sort function

If you are really using only three variables and six values, then make 
a function that includes a few "if" commands and have that return a 
value that is useful to you.  Or make a handler that modifies a couple 
variables, perhaps reference parameters.

Dar Scott

More information about the use-livecode mailing list