Page 1 of 1

Command to interrupt script execution in :if?

Posted: Tue Jun 10, 2008 8:48 am
by sergeda
Hi all.
I'm trying to make simple check at start of my script and if check fail just interrupt script execution. I can't find a command to do this in manual. Exit, quit or something else? Can somebody help me with this?

Re: Command to interrupt script execution in :if?

Posted: Tue Jun 10, 2008 11:26 am
by mrz
:if ( condition = true ) do={ 
   < your code >
}
Thats it if check fail your code will not be executed

Re: Command to interrupt script execution in :if?

Posted: Tue Jun 10, 2008 11:56 am
by sergeda
Thank you mrz
But what I actually want to achieve is to make something like:
:if ( condition = true ) do={
< command wich brakes execution of script >
}

I just don't want to use multiple nested if but if it is the only way, I'll try.

Re: Command to interrupt script execution in :if?

Posted: Tue Jun 10, 2008 12:05 pm
by mrz
as far as I know unfortunately nested ifs are the only way. There are no stop script command.

but there could be a workaround:

:if ( condition=true ) do={
/system script job remove [/system script job find script=<script_name>;
}
not sure if it will work but you can try.