Behaviors not honoring script local variables??

Tom Glod tom at makeshyft.com
Tue Jun 26 16:42:20 EDT 2018


yup.... a feature that makes lc driven datagrid possible. :) and many other
things.

On Tue, Jun 26, 2018 at 4:30 PM, J. Landman Gay via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Every instance of a behavior maintains its own separate variable values.
> This is a feature. Globals are the solution if you want them to share the
> values.
>
>
> On 6/26/18 3:19 PM, Bob Sneidar via use-livecode wrote:
>
>> Works with globals, but not script locals.
>>
>> Bob S
>>
>>
>> On Jun 26, 2018, at 13:13 , Bob Sneidar via use-livecode <
>>> use-livecode at lists.runrev.com> wrote:
>>>
>>> Hi all.
>>>
>>> I have a behavior script with a handler:
>>>
>>> local cTableName, cDGName, cPriKey, cAltTable1
>>>
>>> on getStackConstants pParentStack
>>>    -- retrieve stack constants from stack property
>>>    put the stackConstants of pParentStack into aStackConstants
>>>    put the keys of aStackConstants into tConstantList
>>>
>>>    repeat for each line tConstant in tConstantList
>>>       do "put " & quote &  aStackConstants [tConstant] & quote & " into
>>> " & tConstant
>>>    end repeat
>>> end getStackConstants
>>>
>>> When I trace the handler, it does indeed set the values for the local
>>> variables, but as soon as the handler exits, the script local variables are
>>> all reset! This does not happen when I do the same thing in an object
>>> script. Is there something about behaviors preventing script local
>>> variables from retaining their values??
>>>
>>> Bob S
>>>
>>
>>
>> _______________________________________________
>> 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
>>
>>
>
> --
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
>
>
> _______________________________________________
> 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