In the following example, the Multiplication procedure uses an optional parameter, Nb2. This optional parameter is indicated after the mandatory parameters, by specifying its default value. In this example, the default value of optional parameter is set to 10.

 

PROCEDURE Multiplication(Nb1 is int, Nb2 is int=10)

MyResult is int

MyResult = Nb1 * Nb2

RESULT MyResult

 

The code used to call the procedure is as follows:

 

res is int

res = Multiplication(6)

// Res is equal to 60