Behaviors not honoring script local variables??

Bob Sneidar bobsneidar at iotecdigital.com
Tue Jun 26 17:22:10 EDT 2018


Hmmm... something you said set me to thinking. Suppose I already had the instance of a behavior opened in the script editor with a breakpoint set. I then execute a handler in another object with the same behavior. Which instance is the script editor going to show me?? Ideally, it should open a new script editor window for every instance, otherwise the variable watcher is going to produce unexpected results. It may also confuse the engine, which would explain why I was seeing the results I was seeing, especially if I was terminating execution mid handler for whatever reason. 

Bob S


> On Jun 26, 2018, at 13:49 , Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Yes, well for whatever reason it's working now. I didn't change anything, I just quit and relaunched. It may be some kind of topstack issue where the topstack is changing and I don't know it's happening. 
> 
> Bob S
> 
> 
>> On Jun 26, 2018, at 13:44 , Tom Glod via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> hmmmm.. .... look inside the preferences to the script editor..... try to
>> see if "variable preservation" helps you..i think its an engine property.
>> 
>> On Tue, Jun 26, 2018 at 4:41 PM, Bob Sneidar via use-livecode <
>> use-livecode at lists.runrev.com> wrote:
>> 
>>> 
>>> 
>>>> On Jun 26, 2018, at 13:30 , 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.
>>>> 
>>> 
>>> I don't want to share the variables. I want them to be local to the
>>> script. The trouble is, they reset as soon as the handler exits. Inside the
>>> handler, they all seem to be fine! And ONLY the openStack handler seems to
>>> be having the issue, because any other handler, even preOpenStack will
>>> retain the script local values! GAH!
>>> 
>>> 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
>>> 
>> _______________________________________________
>> 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