Thanks Ali, that's a nice idea.

But just in case anyone else does the same as me (i.e. copy/paste it without looking too hard :-) :

there should NOT be an 'else' clause in there .... right now it will either set the variable OR do the initialization, when in fact it should do BOTH or NEITHER; i.e. it should be

local sIHaveBeenInitialized
on librarystack
   if sIHaveBeenInitialized is empty then
     put the millisecs into sIHaveBeenInitialized
     doLibraryInitialization
   end if
end librarystack

On 15/05/2017 09:40, Ali Lloyd via use-livecode wrote:
One simple way to make this slightly nicer would be to make sure all your
initialisation happens in a separate handler eg (doLibraryInitialization),
and use your script local lock in the libraryStack handler

local sIHaveBeenInitialized
on librarystack
   if sIHaveBeenInitialized is empty then
     put the millisecs into sIHaveBeenInitialized
   else
     doLibraryInitialization
   end if
end librarystack
Then you don't need a separate library_reset handler, just call
  doLibraryInitialization from the message box. Of course you still might
want to flip it from public to private once you deploy.
_______________________________________________
use-livecode mailing list
use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to