exit

Prev Next

Function Names

exit

Description

Program execution will stop. If a numeric parameter is provided, then it will be passed as exit code back to the operating system or calling process.

Call as: procedure

Restrictions

Indirect parameter passing is disabled

Parameter count

0 - 1

Parameters

No.TypeDescription
Opt. 1
input
numeral Exit code

Default value: 0

Examples

       savecode
       if (member count(command line arguments[]) == 2)
       {
               echo( command line arguments[1] );
               echo( "Returning 5" );
               exit(5);
       }

       echo("Start this program recursively");
       rv[] = system( "b4p REF_Function_exit.b4p -wx Nesting" );
       echo("Exit code received = ", rv[] );

Output

Start this program recursively
Nesting
Returning 5
exit (); called
Code execution will stop.  Exiting program.
________________________________________________________________________
Exit code received = 5
Done - Press ENTER key

See also

end
abort