Exit in the script

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
jacky.zhang
Newbie
Posts: 2
Joined: Mon Mar 04, 2013 1:14 am
Contact:

Exit in the script

Post by jacky.zhang » Mon Mar 04, 2013 1:20 am

Hello there,

I come across this problem, when using 'exit', the script doesn't exit while some other Onevent sub is calling. is that Macro scheduler limitation or any work around?

Checked the log file, it seems that:

Start: Exit>1
'------- go to other onevent sub'
'infinite loop
never got "End:Exit>1 " in the log file any more

Thanks

Jacky

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Mar 04, 2013 8:30 am

The event sub needs to finish. It would only exit once finished and returned to the main thread, or if you exit in the sub.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

jacky.zhang
Newbie
Posts: 2
Joined: Mon Mar 04, 2013 1:14 am
Contact:

re: Exit

Post by jacky.zhang » Mon Mar 04, 2013 9:22 pm

Marcus Tettmar wrote:The event sub needs to finish. It would only exit once finished and returned to the main thread, or if you exit in the sub.
Hi Marcus,

Thank you for your prompt reply. However it seems that I didn't make my question clear.

It looks like during the script executing "EXIT", some other OnEvent NewWindow Sub is called, and the "Exit" can't be finished. I checked the log file that ".... Start: Exit", and following some OnEvent Sub, never got "...End: Exit" any more.

Is there anyway to get rid of that? Make sure one statement "Exit" has been completed before starting other statement?

Thanks

Jacky

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Mar 05, 2013 9:12 am

No, sorry, it all depends when the other thread gets executed. At present Exit isn't given any special priority so any other thread that already has the processor will have to complete.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts