Arkon2 0 Posted December 20, 2009 Hi, Can anybody tell me how to exit from an SQF script at any point - is this possible? Arkon2 Share this post Link to post Share on other sites
shuko 59 Posted December 20, 2009 (edited) You can for example terminate the whole script: _scriptHandle = [] execvm "myscript.sqf"; terminate _scriptHandle; Or, by breaking out to the main scope of the script and letting it run to the end (where it automatically exits): scopename "mymainscope"; while {true} do { if (somethingIsTrue) then { breakto "mymainscope"; }; }; Obviously, it's recommended to write the script so it doesn't need breakto. In this simple and silly example, you could just make the while condition to a variable and changing it to a false. Edited December 20, 2009 by Shuko Share this post Link to post Share on other sites
Bon 12 Posted December 20, 2009 (edited) To exit the script from within the script itself the simplest way is if(true) exitWith{}; The true you then can replace by any condition you want. This command is supposed to exit the current scope, but works a charm in script scope itself. Here the detailed description: http://community.bistudio.com/wiki/exitWith Edited December 20, 2009 by Bon Share this post Link to post Share on other sites
Arkon2 0 Posted December 20, 2009 Thanks guys for all your answers - having a look at them all... Share this post Link to post Share on other sites