3.2.4 Special Function Commands

Scilab has several special commands which are used almost exclusively in functions. These are the commands

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. The -1-> prompt indicates that the current environment created by the pause command is the environment of the function and not that of the calling environment. 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.