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

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

Recommended Posts

Posted

So I created a custom dialog box within a script.

How do you exit the script if the user clicks cancel? Right now when that is clicked the script continues.

I can't figure it out.

Thanks

Posted

Show Custom Dialog [ OK ; Cancel ; "Hit OK to continue.." ]

If [ Get ( LastMessageChoice ) = 2 ]

... do whatever you wish if they cancelled

Halt Script

End If

... do whatever if they wish to proceed

Posted

Why "Halt Script", why not "Exit Script" coz if this script was called from another script, you'd end up with unfavorable results.

Posted

Well, no not necessarily... it all depends on the context you use it in.

I.e. Halt script is used primarily as away to "abort" the script... sigh, see the help definition below

EXIT SCRIPT

Forces sub-scripts or external scripts to stop immediately and return to the main script, with or without an optional script result.

If the optional script result is specified, the script result is returned and stored in the main script until another sub-script that returns a value is called. The script result gets deleted when you exit the main script. The script result can be stored in a local or global variable for later use.

HALT SCRIPT

Forces all scripts (including any sub-scripts or external scripts) to stop immediately. While pressing Esc will also halt a script, Halt Script is useful if you are also using the Allow User Abort script step to disable the Esc key. Halt Script stops the script when Allow User Abort is set to Off.

...Also, is it really that hard to use because or even at worst 'cause rather than coz i mean its 4 more letters...

And it looks really weird lol, if you are going to SMS...isize one word, why not SMS...isize the whole thing:

Y "Halt Script", y nt "Exit Script" coz if this script was calld frm nother script, yood nd up with unfav. results.

Well i can't really do it but you get the idea..

Posted

Hi Breezer!

I'm aware of the difference but either way I went, I risked guessing wrong so you are absolutely correct - I should have added "Halt Script if you wish to stop all running scripts or Exit Script if you only wish to terminate this script". I will try to add that phrase each time I respond to a script question which requires either of these steps. :wink2:

An aside (as I believe Genx was trying to say), Exit Script is NOT safer. To have main script continue when the purpose is to stop is just as dangerous as stopping a script which should allow continuance of its main script. Only the Developer can make that call and if we aren't told then error can happen on either side. Adding clarification EACH time is the only safe thing to do...

LaRetta

Posted

I never use the EXIT or HALT script steps. Instead I prefer to have all my scripts run to completion, and subsequently return to their calling script as the 10,000+ scripts I have depend on a proper termination of the initial starting script, however many levels of subscripting this involves.

Posted

I think he uses recursion, where one script calls another script depending on the result.

Please note that I'm here to learn not criticize, so, if my comment was misconstrued, my appology go to LaRetta and all these fine FM Forum members.

Posted

Your post was taken in the spirit it was intended, Breezer. It is the mix of different opinions and varying perspectives which makes Forums so great. And none of us (when we post) can think of everything, allow for all contingencies or always provide the best answers. In fact, even the greatest minds here (not mine) can occassionally err. I never hesitate to step into a post if I have something to add and I always appreciate others stepping into mine as well. Questioning is truly our greatest possession because questioning enhances learning and we're ALL here to learn (or should be).

The person posting may not understand the difference on when to use those two script-steps. Thanks to your post, I'll try to remember to mention it from now on. If I forget again, speak up please! And if you ever think of a better calc or approach to a problem, tell us! It is only by sounding out our ideas here on Forums that we can all find better ways of FMing. :wink2:

Posted

Lol, Breezer its all good. The forums are here for this very reason, as LaRetta said, if you think someone missed something please correct them, better a correction being said now than a person using a technique and then it stuffing them up later. I've been corrected a million times when i've forgotten to mention something lol.

It's also a good place for debate, with FM there's a million ways to do one thing, often hard to decide on the best so we all post our sometimes contradicting opionions -- and at the end, we're all confident we've got the best out of the post and sometimes learnt something new. We're here to help but also to learn so again... it's all good.

Posted

Thanks ALL, now I can sleep better at night without having one eye open. This tells me that maybe we should have a topic "To Halt or NOT to Halt, what's the best solution?" :giggle:

This topic is 6672 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.