Strange hang

Kay C Lan lan.kc.macmail at gmail.com
Tue Jan 15 03:47:08 EST 2013


THANK YOU Pete.

Now that doesn't work for me. Fortunately I've never passed parameters
as reference; because basically I'm not smart enough to have ever
figured out when to - I've just created script local variables
instead.

On Tue, Jan 15, 2013 at 2:29 PM, Peter Haworth <pete at lcsql.com> wrote:
> I believe what you cannot do is pass an array element by reference. So your
> faddnum function cannot be declared as:
>
> function faddnum @pnum
>
> Not that you would want to do that in a function but you might be tempted
> to make it a command defined that way.
>
> Pete
> lcSQL Software
> On Jan 14, 2013 10:01 PM, "Kay C Lan" <lan.kc.macmail at gmail.com> 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
>>
> _______________________________________________
> 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