Part 8
Parameter Mode "replaces x"


The incoming value of x (#x) will be replaced with another value by the operation as specified in the ensures clause, and the outgoing value of x will be that new value.

Operation SetToFive (replaces I: Integer);
     ensures: I = 5;

Main program:
     Var Num: Integer;
     Num := 1;    // I will b
e replaced by the operstion.
     SetToFive (Num);

Then after operation SetToFive executes:
     Num = 5;