Seeking recommendations / suggestions for use of library stacks.

Alex Tweedly alex at tweedly.net
Mon May 15 20:01:11 EDT 2017


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 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