Sign in to follow this  
jfiddler

How do I get user confirmation?

Recommended Posts

Is there a way to pop up an "Are you sure" button for the user, with yes / cancel options? When a user presses a specific button, I want to get an explicit confirmation, just in case.

Thanks

Share this post


Link to post
Share on other sites

I want to have a button "Exit Program"

that does ff.

***************************

Action 1 is a quick seqence that executes

private xx =xit_program_code() // returns 0, if AOK to exit

// code asks if user really wants to exit, if yes, writes some data to files

// if files written w/o mishap, returns 0, otherwise non-0

if (xx !=0)

return()

endif

// Regretably, it appears that the return() does NOT work in a quick seq.

// and I get a program exit

***************************

Action 2

exit

<<<<<<<<<<<<<<<<<<<<<<<< end button

Is there another way around this???????????????????????

thanks

eka

Share this post


Link to post
Share on other sites

Actually, return() works just fine. The thing is, it just ends the quick sequence. The second action still executes since its not part of the same quick sequence. There is no way to short-circuit the action chain. If you click on the component, all the actions will execute no matter what. What you need to do is exit from the quick sequence using system.quit():

if (xx == 0)
   system.quit()
endif

Actually, you will find that pretty much all the other actions can be performed in script in the quick sequence. In fact, we will likely drop most of the actions in later releases and just make it a quick sequence by default.

Share this post


Link to post
Share on other sites

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
Sign in to follow this