Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7167 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I can't find any documentation about the Current Script option (Halt/Exit/Resume/Pause) when defining a button that runs a script.

I'm guessing that the "Current Script" is a script which is currently paused to allow the user to interact with the GUI?

Working from that assumption, the "Resume" option is baffling: with that option, will clicking a button cause the "current script" to continue executing, and simultaneously cause the designated script to execute? Sounds kind of like multithreading to me, although I can't believe that's what really happens.

I think I'm short a clue or two here. Any help is greatly appreciated...

Chap

Posted

I use the resume in a button when I have paused a script to allow the user to enter some data, then select the resume button or press enter, both of which will resume the script that was paused. To cancel the script, I have a button that will halt the current script, call a different script to halt the function (close the window or whatever is needed).

Posted

I use the resume in a button when I have paused a script to allow the user to enter some data, then select the resume button or press enter, both of which will resume the script that was paused. To cancel the script, I have a button that will halt the current script, call a different script to halt the function (close the window or whatever is needed).

Thanks - that helps - I'm guessing that, for your purpose, when you assign the "Resume" option to a button you probably do NOT actually assign a script to the button as well.

Maybe I should ask: *when* does the Current Script option take effect - at the moment the button is clicked, or after the script that's assigned to the button exits? (If the former, I'd think you'd have the possibility of two scripts running at once - and I've never heard of multithreaded FM scripts.)

Posted

Why don't you try this and see for yourself? I mean, define 2 scripts:

SCRIPT ONE:

Pause Script

Show Message ["Script One"]

SCRIPT TWO:

Show Message ["Script Two"]

Define a button to perform SCRIPT TWO and to Resume current script. Now run SCRIPT ONE from the menu, and while it's paused click the button.

Posted

blush.gif Oh yeah! Thanks. That was instructive. The buttonized script (SCRIPT 2) runs to completion, and only THEN does the current script (SCRIPT 1) resume or exit, etc.

I fiddled around a bit to see if it was possible to deadlock, like having the button script ultimately try and run the current script. Rather than getting blocked, the button script seems to enqueue a request to run the current script, and when the current script is allowed to resume and complete, the queued request then runs.

As far as I can tell, since the current script has to already be in a paused state in order for a button to be clickable, the Pause option just means "remain paused".

This topic is 7167 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.