end
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 or superior B4P program which has started this program using start() or include() functions. The key difference to exit(): Exit will stop B4P in all cases, even if called by a superior B4P program.
Indirect parameter passing is disabled
0 - 1
No. | Type | Description |
---|---|---|
Opt. 1 input |
numeral | Exit code Default value: 0 |
savecode
if ( member count(command line arguments[]) == 2 ) // Define function only once
{
define procedure( foo )
{
echo("Demonstrate ending from here with code 5");
end(5);
}
}
if (member count(command line arguments[]) == 2)
{
echo( command line arguments[1] );
echo("Calling foo ...");
foo;
echo("This text will not appear");
}
echo("Start this program recursively");
rv[] = start( "./REF_Function_end.b4p", "Nesting" );
echo("Exit code received = ", rv[] );
Start this program recursively
Nesting
Calling foo ...
Demonstrate ending from here with code 5
end (); called
Code execution will end. Leave or go to superior code.
________________________________________________________________________
Exit code received = 5
Done - Press ENTER key