How do I get user confirmation?


Recommended Posts

  • 2 years later...

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

Link to comment
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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.