$DefaultVarInfo
The $DefaultVarInfo directive (available with the Professional license) allows default variable information (i.e., the guess value,lower and upper limits, units, alt units, style, and display format) for variables in the main program, Subprograms, Functions and Procedures to be specified. This directive is similar to the $VarInfo directive but it differs in that the $VarInfo directive is used to set information for specified existing variables, whereas $DefaultVarInfo will set variable information for all new (and optionally existing) variables that begin with specified characters.
By default, the guess value for all new variables is 1.0 and the lower can upper limits are -inf and +inf. The display format is set to Auto and the style is set to normal. The units are alternate units are not set. All of these default characteristics can be reset with the $DefaultVarInfo directive.
The format of the $DefaultVarInfo directive is as follows
$DefaultVarInfo/A <xy> Guess=V1 Lower=V2 Upper=V3 Units='XXXX' AltUnits='YYYY' Display=F1 Style=Bold
The $DefaultVarInfo directive should be placed at the start of the program unit (Main program, Subprogram, Function or Procedure) for which it will be applied. It should be placed before any $VarInfo directives that will override the defaults for specific variables. The /A is optional. If it is provided, the directive will be applied to all variables (existing and new) in the program units. Without /A, the directive only applies to new variables.
The first parameter following the $DefaultVarInfo keywords provides the starting characters of the EES variables for which the defaults will be applied. These characters must be enclosed within bracket characters (<>) with no spaces. For example, if <xy> is specified, the default information that follows will be applied to all variables (including array variables) that begin with xy. (Note that EES is case-insensitive). If no characters are provided, i.e, if the parameter is <>, the defaults that follow will be applied to all variables in the program unit.
The remaining part of the directive consists of one or more keywords (shown in bold above) followed by an equal sign and a specification. It is only necessary to provide the keyword=specification terms that you are interested in setting and they can be provided in any order.
V1, V2, and V3 shown as the specifications for Guess, Lower, and Upper, can be a numerical value or the name of an EES variable. In the latter case, EES will use the current value of the variable as the value for the specification.
The Units specification can be a string constant (within single quotes) or a string variable. For example, $DefVarInfo <T> Guess=300 Units=K]will set the guess value all variables whose name begins with T to be 300 and the units to be K.
The AltUnits specification operates in the same manner as the Units specification. It must have the same dimensions as Units.
The Display specification consists of two characters, e.g., F3, as detailed in the Display Formats section.
The Style specification controls the appearance of the variable in the Solutions window. Allowable specifications are Normal, Italic, Bold, Boxed or Hidden.
Note that this directive is applicable for Subprograms, Functions, and Procedures, as well as for the main program. However, keywords Guess, Lower, Upper, and Key are ignored if the directive is used within a Function or Procedure as these program units do not use guess values or bounds.
Example 1:
{The following directive will set the guess value for all new variables in the program unit (i.e., variables that have not be previously defined or used) to 100.}
$DefaultVarInfo <> Guess=100
Example 2:
{The following directive will set all the units of all variables in the program unit that begin with letter T to K. Other characteristics of existing variables, such as the guess value, are unaffected.}
$DefaultVarInfo/A <T> Units=K
Example 3:
{The following directive will set all the display format of all variables in the program unit that begin with P to fixed decimal with 2 digits to the right of the decimal point and bold font. Other characteristics of existing variables, such as the guess value, are unaffected.}
$DefaultVarInfo/A <P> Display=F2 Style=Bold
See also: Variable Info