- Importing Parameters
Importing parameters are values that the method receives from the caller. A method can have any number of importing parameters.
By default, importing parameters are mandatory, but there are two ways to make them optional:
- Using the OPTIONAL addition. The parameter is optional and its default value is the initial value appropriate to the type of the parameter
- Using the DEFAULT <val> addition. The parameter is optional and its default value is the value that you specified as <val>.
Inside of a method, you may not change importing parameters. If you attempt to do so, you will cause a syntax error.
- Exporting Parameters
Exporting parameters are results that are returned by the method. A method can have any number of exporting parameters. All exporting parameters are optional - a caller only uses the values that it actually needs.
- Changing Parameters
Changing parameters are values that the method receives from the caller. Unlike importing parameters, the method can change the values of these parameters. They are then returned to the caller under the same name. A method can have any number of changing parameters. Changing parameters are mandatory by default; you can make them optional in the same way as importing parameters.
- Returning Parameters
A returning parameter is a method result that can be used directly in an expression. A method can only have one returning parameter. Returning parameters have to use a special form of parameter passing which is called pass-by-value. This form of parameter passing is defined by surrounding the parameter name in brackets (no blanks!) and preceding it with keyword VALUE.
Keyword RAISING is used to list the exceptions the method might raise to indicate an error situation. The calling program can then react to the error.