Page 1 of 1

Exit script function

Posted: 27 Jul 2017 16:28
by bogdyro
Hi Martin. I would like to have a function that exits the current script directly. Kind of like the break statement exists from a loop.
Currently I have to include all the statements I want executed inside the brackets of an if statement and it confuses the code a bit.
Or maybe something in the form of a throw exception statement with some kind of info attached to it. Then I would link that script to a debug dialog or other script for error handling.
Thanks.

Re: Exit script function

Posted: 27 Jul 2017 20:17
by Martin
Hi,

You can use the return statement for this:

Code: Select all

log(1);
if (xyz) return;
log(2);
Regards,
Martin

Re: Exit script function

Posted: 28 Jul 2017 09:19
by bogdyro
Ok Martin, didn't know that. Thx