Passing unknown number of referenced variables to a function
Trevor DeVore
lists at mangomultimedia.com
Wed Oct 27 14:21:50 EDT 2004
Is it possible in transcript to have a function that supports the
passing of multiple referenced variables and assigning values to those
variables? The idea is that I could define a function like this:
function myFunction @pData
repeat with i = 1 to paramCount()
put "someData" into paramVar(i)
end repeat
end function
Where the function could loop through the number of parameters and put
values into the variables that were passed by reference. It seems you
can only get the value of a parameter that was passed in but not
defined in the function definition, not the actual variable name
(variableNames reports the defined variables).
I guess I could just define a bunch of parameters (ie. @pData1,
@pData2, @pData3, etc.) and then loop through the parameters that way
but I'm hoping there is a more elegant way.
--
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com
More information about the use-livecode
mailing list