updating oE abort


<built-in> procedure abort(atom error) 

aborts execution of the program.

  1. error : an integer, the exit code to return.

error is expected to lie in the 0..255 range. Zero is usually interpreted as the sign of a successful completion.

Other values can indicate various kinds of errors. Windows batch (.bat) programs can read this value using the errorlevel feature. Non integer values are rounded down. A Euphoria program can read this value using system_exec.

abort is useful when a program is many levels deep in subroutine calls, and execution must end immediately, perhaps due to a severe error that has been detected.

If you do not use abort then the interpreter will normally return an exit status code of zero. If your program fails with a Euphoria-detected compile-time or run-time error then a code of one is returned.

Example 1:
if x = 0 then 
    puts(ERR, "can't divide by 0 !!!\n") 
    z = y / x 
end if 
See Also:

crash_message, system_exec

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu