Setting 'it' in caller

Dar Scott dsc at swcp.com
Tue May 17 02:15:32 EDT 2005


On May 16, 2005, at 9:54 PM, J. Landman Gay wrote:

>> How do I put a value into the instance of 'it' in the calling 
>> function?
>> For example, suppose I want to create a custom command 
>> 'getCurrentRobotName' that returns an error in the result and the 
>> current name in 'it'.  This is 'it' in the handler that invokes 
>> 'getCurrentRobotName'.
>
> Most commonly, use a two-line (or two-item) result. Put the name in 
> line 1 and the error in line 2 (or vice versa.) Then parse the strings 
> in the calling handler.

I also put the answer (name) in a referenced variable (@) and put the 
error in the result (return it).  However, I'm designing an API for a 
library and I'm envious of the ability of built-in commands to set 
'it'.  As they sing in Disney's Jungle Book, "I wanna be like 
you-oo-oo!"

Dar



More information about the use-livecode mailing list