next up previous
Next: System Parameters Up: Program Structure Previous: Comments

Parameters

 

A parameter can be declared in several ways depending on whether it is a scalar or a vector, whether or not it has a default value, and whether or not it is a ``constant.'' Some example declarations are:

parameter int fred
constant parameter float jim := 5
parameter float george[10]
parameter float ted[3] = [2.0 1.7 11]
parameter string name := "file_name"
constant parameter string comments[2] := ["comment 1" "comment 2"]

As the examples show, the parameter declaration begins with the reserved word parameter (optionally preceded by the reserved word constant). This is followed by a type which can be int , float , or string. Next comes a name with a size specification if the parameter is a vector. Finally, there is an optional assignment statement consisting of either = or := and a value.

Parameters provide a means of getting information to the program at run time. The use of parameters is discussed in section 4.1.





Robert Marsa
Thu Jun 1 09:34:30 CDT 1995