AW: is find or offset with wildcards possible?

Mark Waddingham mark at livecode.com
Wed Feb 10 12:21:40 EST 2016


On 2016-02-10 18:06, Tiemo Hollmann TB wrote:
> Bonsoir Thierry,
> ui, thats fancy. I haven't seen yet a function which changes input
> parameter as a kind of result

This is actually quite a rare pattern in the engine (when exposed as 
function type syntax at least)... However, user handlers can obviously 
do this with the use of the '@' symbol:

command returnMoreThanOneValue pInput, @rOutput1, @rOutput2
   put item 1 of pInput into rOutput1
   put item 2 of pInput into rOutput2
end returnMoreThanOneValue

(This works for on, command, function and private variants too).

If you prepend your parameter with @ then that handler must be called 
with something which looks like a variable, and in that case the 
variable itself is passed to the handler, rather than the variable's 
value.

Prior to 7 you could only use actual variables in such parameters, but 
from 7 you can use array elements too. i.e.

returnMoveThanOneValue "1,2", tArray[1], tArray[2]

Will work.

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list