4. Variable Parameters. Procedllre MinMax shows the case ofthe variable parameter. The actual parameter must be a variable; the corresponding formal pw'ameter must be preceded by the symbol var and becomes a ,ynonym for this actual variable during the entire execution If the procedure. Any operation involving the formal paran leter is then performed directly upon the actual parameter, Use variable parameters to represent the results of a pn Icedure - as is the case for Min and Max in Program 11.2. J urthermore, if Xl ... Xn are the actual variables that com~pond to the formal variable parameters VI ... Vn, then, 1 ... Xn should be distinct variables. All address calcuLltions are done at the time of the procedure activation. Hence, I f a variable is a component of an array, its index expression is ,'valuated when the procedure is activated. Note that a compolllcnt of a packed structure or a tag field in a variant record must not appear as an actual variable parameter, thus avoiding implementation problems for calculating addresses. 

When no symbol heads the paumeter section, the parameter(s) of this section are said to be value parameter(s). In this case the actual parameter must be an expression (of which a variable is a simple case). The corresponding formal parameter represents a local variable in the activated procedure. As its initial value, this variable receives the current value of the corresponding actual parameter (i.e., the value of the expression at the time of the prlCedure activation). The procedure may then change the value of this \ .lriable through an assignment; this cannot, however, affect the value ()f the actual parameter. Hence, a value parameter can never represen. a result of a computation. Note that file parameters or structured variahles with files as components may not be specified as actual value par. I meters, as this would constitute an assignment. 

The difference in the effects 01 value and variable parameters is shown in Program 11.3. 

The following table summarize', the correct kinds of parameters for formal and actual parameter lists. 

