How to tell when IDE is done loading

J. Landman Gay jacque at hyperactivesw.com
Sun Dec 28 14:20:40 EST 2014


On 12/28/2014 12:44 PM, Michael Doub wrote:
>
> Note that the OpenStack message is received before the initialization of
> the IDE has completed so when the revloadedstack function was called, it
> was not found.   if you look at the IDE home stack, you will see the
> interrupts are blocked until all of the IDE initialization is completed.
>
> I think that some of your assumptions regarding the loading of stacks
> may be incorrect.  This is clearly showing that a users stack does in
> fact start execution before livecode initialization is completed.
>
> The other interesting thing to note is that I found a plugin that looks
> like it was setting allowinterrupts to false and never setting it back
> to true.  I put that counter in the Mark_IDE_done handler so it would
> not fire forever as I was debugging.  Anyway, I sent off an email to the
> developer of the plugin to start the discussion with him off line.
>
> I hope this clears things up for you.

Not entirely. It shows how you tested the message order, but not what 
you want your script to do or what your final goal is. Or are you just 
trying to find out which LC stacks are open?

It does look like I was wrong about the sequence specifics. But however 
it works, I think many of us use a delayed call to do something after 
the IDE is done launching. Whatever your final goal is, it seems it 
could be more easily done with this:

on openStack
  send "myHandler" to me in 1 second
end openStack

on myHandler
   -- do actions here
   -- if the goal is to see which stacks are open, query revloadedstacks 
here
end myHandler

By the time myHandler triggers, the IDE is loaded. If you think it may 
take longer on slow machines, use 2 seconds. Put the handlers on the 
first card, so that openstack won't trigger more than once.

I'll admit this is a sort of fuzzy workaround, so your request for a new 
engine message is probably useful. But until we get that, the above 
seems to work.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list