The following example runs the following foo function which illustrates these commands. In the example, the first call to foo passes an argument which cannot be used in the calculation of the function. The function discontinues operation and indicates the nature of the error to the user. The second call to the function suspends operation after the calculation of slope . Here the user can examine values calculated inside of the function, perform plots, and, in fact perform any operations allowed in Scilab.
Control is returned to the function by the command return .
Operation of the function can be stopped by the command quit or abort . Finally the function terminates its calculation returning the value of z . Also available in the environment is the variable s which is a local variable from the function which is passed to the global environment.