Strange hang
Peter M. Brigham
pmbrig at gmail.com
Tue Jan 15 09:34:21 EST 2013
I believe that all you have to do is put the array element into a variable first before passing it to the command or function:
on mouseUp
put 4 into aArray[1]
put aArray[1] into msg
put aArray[1] into tElement -- the important step
put fAddNum(tElement) into tBobTest
put cr & tBobTest after msg
end mouseUp
-- Peter
Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig
On Jan 15, 2013, at 1:01 AM, Kay C Lan wrote:
> On Tue, Jan 15, 2013 at 12:44 PM, Robert Sneidar <slylabs13 at me.com> wrote:
>> Yeah I misunderstood. The only thing you cannot do (and there is/was a request to implement this) is to pass an element of an array as a parameter to a command or function eg. put myFunction(myArray[1]) into bobtest.
>>
>> Bob
>
> Bob,
>
> Your scaring me! This is essential in my current project, I've
> basically shotgunned my scripts with such, so if you're telling me
> it's going to break at some stage, I'm going to cry.
>
> 1) New Main Stack
> 2) Add button
> 3) Copy and Paste this script into the button's script:
>
> on mouseUp
> put 4 into aArray[1]
> put aArray[1] into msg
> put fAddNum(aArray[1]) into tBobTest
> put cr & tBobTest after msg
> end mouseUp
>
>
> FUNCTION fAddNum pNum
> add 10 to pNum
> return pNum
> end fAddNum
>
> Please tell me I've misunderstood and it's something else that can't be done.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list