Hi Roland,

This is the only reply of yours that I see.


On 2/26/18 4:13 AM, R.H. via use-livecode wrote:
Thanks, Phil and Tom

I already replied, but I cannot see my first reply to your answers.

Did it appear in the list?


Phil:
"quitMe" should be sent before 'saveMe' is executed, because the 'save'
command is blocking. It would prevent 'quitMe' from being sent until (in
this case) 1 second after 'saveMe' has finished.

Well, it is blocking. Issuing "quit" just quits if messages are locked.So,
to quit before save would require not to force a quit. Right? I will test.

You're right, but that's not what my code does. It sends 'quitMe' (which contains the 'quit') 1 second after 'saveMe' has started. As you may know, 'send in x seconds' adds 'quitMe' to the pendingMessages queue, so it will execute as soon as the designated time has passed AND no other handler is running.

For what it's worth, the correction I made to my own code is still not correct. The whole thing should look like this:


local sMyTildeFilename

on closeStack
    -- create a path to the 'tilde' file (which doesn't yet exist)
    put (the filename of me & "~") into sMyTildeFilename

    -- add 'quitMe' to the pendingMessages
    send "quitMe" in 1 second

    -- save this stack
    saveMe
end closeStack


command saveMe
   lock cursor
   set the cursor to watch
   save me -- creates the tilde file at beginning, deletes it at end
end saveMe


command quitMe
   -- wait until tilde file is gone, then quit
   if there is a file sMyTildeFilename -- 'save' has not completed yet
   then -- try again later
       send "quitMe" to me in 0.5 seconds
   else
       unlock cursor
       lock messages
       quit
   end if
end quitMe



Phil


The main problem is that the IDE is ok, even though saving takes a long
time, but no errors I can see. The standalones are the culprit, and I have
limited to access to other peoples computers using my standalones. And on
my machine the problem does not appear regularly.

// I hope this message appears, otherwise I will have to check what is
wrong sending messages to the list. //

Thanks
Roland
_______________________________________________
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


--
Phil Davis


_______________________________________________
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