People have already mentioned 'do', 'merge()' and using arrays.  

I'll add these:
Set the script of an object.  
Use a switch statement.
Set a chunk of the value of a variable, perhaps a global.  
In limited situations, 'value()' might be useful.  
Pass the variable to the function rather than its value using @.

Both 'do' and set scripts are limited to 10 lines in standalone applications.  
Perhaps 'do' is the most direct solution to what you want to do.

(I have found 'merge' to be powerful in some cases.)

I suspect what you want to do might be done well with a (perhaps global) 
variable containing an array.  Like this:

        put "202 Main Street" into stuff[ tAddress ]

However, maybe the @ fits into your scenario.  Put an @ in front of a parameter 
in a hander (command or function) and when it is called with a variable the 
variable is passed not the value; use of the parameter is the same as the use 
of the original variable.  This is much like pass-by-reference in Java.  Like 
this:

on configureLocation @pAddress, @pCity, @pState, pLongitude, pLatitude
        ...
        put "202 Main Street" into pAddress
        ...
end configureLocation

(Having--tongue-in-cheek--thrown candy at speakers at a RunRev conference who 
promoted their "morals" in using variable prefixes, I have to say that the use 
of such prefixes above does not constitute a promotion of such use, but only 
exists as an aid in communicating the example.)

I wish you well in this.

Dar Scott
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to