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.
Exit script function
Moderator: Martin
Re: Exit script function
Hi,
You can use the return statement for this:
Regards,
Martin
You can use the return statement for this:
Code: Select all
log(1);
if (xyz) return;
log(2);
Martin
Re: Exit script function
Ok Martin, didn't know that. Thx