Quiting George script from a function

A forum dedicated to George scripting questions
Post Reply
brianottosen
Posts: 10
Joined: 20 Dec 2012, 13:30

Quiting George script from a function

Post by brianottosen »

Hi all

I am trying to make George Script stop completely from within a function if an error has occurred.

According to http://wiki.tvpaint.com/index.php?title=EXIT" onclick="window.open(this.href);return false;, "EXIT" "Quits the George program." but it seems to me that EXIT only exit the current function and not the entire script.

Any inputs?

Brian.
:-)
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Quiting George script from a function

Post by Svengali »

Since the interpreter can't know whether you just want to exit the function or exit the entire script...

Initialize a global ExitFlag = 0.
Inside any function at the point where you want to make a script-exit, set the global ExitFlag = 1, immediately before you EXIT from the function.
Back in the main section, immediately after you've called any function that might contain a script-EXIT, test the ExitFlag and if == 1, then immediately EXIT the main section and you're out.

Sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Fabrice
Posts: 10077
Joined: 17 Jul 2007, 15:00
Contact:

Re: Quiting George script from a function

Post by Fabrice »

thanks Sven :)
Fabrice Debarge
brianottosen
Posts: 10
Joined: 20 Dec 2012, 13:30

Re: Quiting George script from a function

Post by brianottosen »

Thanks for your prompt reply Sven.

I have a global errorlevel now which I use where applicable.

Brian.
Post Reply