Previous Topic Next topic Print topic


Variable References

A reference to a variable may occur in a context that expects a value, or it may occur in a context that assigns a value to the variable. If a value is expected, the variable must have previously been assigned a value or must be a variable declared with the INITIAL attribute. A reference to the value of a variable that has no value produces unpredictable results.

The left side of an assignment operator or the format-list of a GET statement causes assignment to a variable. Using a variable as the argument to a procedure or function call may also cause assignment to the variable if the corresponding parameter is given a value. The ADDR, HBOUND, LBOUND, DIMENSION, and LENGTH built-in functions reference a variable but do not expect a value. (However, LENGTH of a varying string variable does require that the string variable have a value.) A variable passed by reference to a parameter does not need to have a value if the parameter is not expected to have a value upon entry to its procedure. The record I/O statements copy a variable's storage and do not require the variable to have a value.

Previous Topic Next topic Print topic