Eyeon:Script/Reference/Libraries/os/exit
From VFXPedia
Contents |
OS : os.exit
Arguments
os.exit( errorlevel )
- errorlevel (optional, number)
A number returned by eyeonScript to the stderr channel, which can be read to evaluate the success of the program.
Returns
This function does not return a value.
Remarks
This function closes eyeonScript, and returns any value specified by errorlevel to the standard error channel of the operating system. The exit function places its one argument in the Standard Error channel of the command processor, where batch files and other applications can read the exit value and act accordingly.
Calling os.exit() from within the Fusion interface will exit Fusion abnormally - use this function only for command line scripts. Tool and Composition scripts launched within the interface are wrapped within a function call, so use the 'return' statement to abort these scripts instead of exit().
Requirements
- eyeonScript 5.0
- Fusion 5.0
Examples
if arg[1] == "1" then
print("we gotone!") -- exit with the value 1 os.exit(1)
end
-- exit with the value -1 to indicate failure os.exit(-1)