script scope variables inexplicably becoming unset

Peter Haworth pete at lcsql.com
Fri Jan 2 20:46:58 EST 2015


Richard,
I confirm that there is a missing behavior but it's on grp "grp_calcids"
 There's also another one on field "Edit" of group "mcp_menu" on the same
card.  I suspect as a result of Dr Hawkins stripping down the stack


Dr Hawkins,
I just finished taking a look at this stack and found some possible reasons
for what's happening.

If you keep keying in letters after the d, the palette stack does appear
and stays as you continue to key in so it's an intermittent problem not
absolute.

First the issue of the palette command clearing a local variable.

At line 56+ of field src_fltrpopup, I found:

palette savChStk

      if word 2 of savChStk is not among the words of the openStacks then
         ck "it's not open!" & cr & "chStk is: " & chStk

The If statement is checking savChStk against the openStacks but your ck
text references chStk, a completely different variable.  I changed the
chStk to savChStk  in the ck command and the display now shows that it
contains the correct value of "stack ctrlChoices" so your palette command
is not destroying the contents of a variable.  If you meant to check chStk,
see later in this email.

Next problem - why is the stack not showing up in the openStacks?

I added a put to the message box in the preOpenStack handler of the
ctrlChoices stack including the milliseconds and I can see that the stack
is opened every time the src_fltrpopup field is altered in any way, so your
palette command is working just fine.  Something must be closing it
immediately it opens in certain circumstances.

There's a handler named  hideChcStk in the src_fltrKeyField of your mcp
stack so I added another put to the message box in there and see it closing
the stack when the ctrlChoices does not appear, but not every time. It also
puts empty into variable chStk which might also explain the first issue.

I also see that button is a behavior for the abbrev field where you key in
"ard" etc.

There's also a mouseLeave handler in the stack script of ctrlChoices which
closes the stack in some circumstances.

Don't have time to check further but the stack is being opened when it
should but being closed immediately in some circumstances.  What those
circumstances are, I'll leave you to figure out.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>

On Fri, Jan 2, 2015 at 4:49 PM, Richard Gaskin <ambassador at fourthworld.com>
wrote:

> Dr. Hawkins wrote:
>
>  I've stripped the stacks to almost nothing, and still have the
>> behavior, reproducibly.  There is almost no code left.
>>
>
> The example stack uploaded there is nearly 1 MB.
>
> I often try to reproduce bugs reported to the RQCC to help them along, but
> with this one I couldn't figure out how to do so.  When I open the stack a
> script editor appears, but apparently not because of a breakpoint.  The
> recipe given was difficult for me to follow; I couldn't figure out how to
> make any palette appear at all.
>
> So having given up on the recipe I was at least curious about how many
> objects there might be in this megabyte stack to estimate the level of
> effort I might need to try to reproduce this issue.
>
> I opened the Project Browser to get a look, and something noteworthy
> immediately stood out:
>
> Group "pp_calcids" of card "entry" of substack "dna" is flagged by the
> Project Browser with a bright yellow warning triangle as having a behavior
> object assigned to it that doesn't exist.
>
> This would seem to fit the description of the problem in which some
> behavior-driven things are working while one doesn't.
>
> Please let us know if simply reassigning that behavior resolves the issue.
>
> As for the local vars clearing with the palette command, is there any code
> in play which initializes those vars on one of the open messages
> (openStack, preOpenStack, etc.)?
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  LiveCode training and consulting: http://www.fourthworld.com
>  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
>  Follow me on Twitter: http://twitter.com/FourthWorldSys
>
> _______________________________________________
> 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