How do you interupt a script.

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
no1g8tor
Posts: 62
Joined: Fri Nov 23, 2007 3:01 pm

How do you interupt a script.

Post by no1g8tor » Sat Feb 09, 2008 2:33 am

I have a a script that call a chain of scripts that are embedded in the stack scripts of many stacks.

On my first script, I open the file dialog box and user has to click on a file to import. If they click on the file and press open, everything continues and works great.

If they click on the "cancel" button, it just closes the dialog and still continues.

How do you stop the script and put in a line of code that says something like:

if it is "cancel" then go to cd "home"
stop script "open Files" -- I know this is not a legal line of code..lol.

Thanks you so much

paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm

Post by paul_gr » Sat Feb 09, 2008 2:56 am

One way is to use something like this to kill the answer dialog::

if it is empty or the result is "cancel" then exit to top

I might be wrong of course.

Paul

no1g8tor
Posts: 62
Joined: Fri Nov 23, 2007 3:01 pm

Post by no1g8tor » Sat Feb 09, 2008 3:19 am

It works, but with one problem.

It just stays on the card I called it from.

Is there a way to have it stop and then goto my 'home" card?

paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm

Post by paul_gr » Sat Feb 09, 2008 5:31 am

straight after the answer line, put

if it is "Cancel" then go to card "whatever"

Paul

Post Reply