Problem with send command???
Jim Ault
JimAultWins at yahoo.com
Thu Jun 26 16:58:00 EDT 2008
Of course, for those who know and use customproperties, a custom property
set is the same thing as an array
----------- copy script lines and paste into the stack script ---------
on dotest
put 42 into tMyArray["Vera"]
put 67 into tMyArray["Chuck"]
put "Dave" into tName
put 123 into tValue
set the custompropertyset of this stack to "tempStorArr"
set the customproperties of this stack to tMyArray
send "TestIt tName, tValue" to this stack
put the customproperties of this stack into tMyArray --update the array
answer the tName of this stack --show that it worked
answer tMyArray[ tName] --show that it worked
--optional
set the custompropertyset of this stack to "tempStorArr" --just in case
set the customproperties of this stack to empty ---purge the properties
end dotest
On TestIt pName, pInt
set the pName of this stack to pInt
--use the array values for any other purpose
--and can be used in any other handlers called in the message path
answer the pName of this stack
--save this stack -- the array is now saved with the stack file
end TestIt
----------- end copy script lines
Jim Ault
Las Vegas
On 6/26/08 1:21 PM, "Mark Wieder" <mwieder at ahsoftware.net> wrote:
> Jim-
>
> Or, more generically,
>
> (button script)
> on mouseUp
> local tMyArray
> local tName, tValue
>
> -- insert sample data
> put 42 into tMyArray["Vera"]
> put 42 into tMyArray["Chuck"]
> put "Dave" into tName
> put 123 into tValue
> combine tMyArray using cr and tab
> send "TestIt tMyArray, tName, tValue" to this stack
> put the result into tMyArray
> split tMyArray using cr and tab
> -- verify the test
> put the keys of tMyArray into field 1
> end mouseUp
>
> (stack script)
> on TestIt pArray, pName, pInt
> split pArray using cr and tab
> put pInt into pArray[pName]
> combine pArray using cr and tab
> return pArray
> end TestIt
>
> ...and thanks for the tip. This is way useful.
More information about the use-livecode
mailing list