Contents - Index

String Variables


EES supports numerical and string variables.  A string variable is identified with a variable name that ends with the $ character.  A string array variable has the $ character just before the left bracket that holds the array index.  The variable name must begin with a letter and consist of 30 or fewer characters, including the $ character.


String variables can be set to string constants which are enclosed with single quote marks, e.g.


A$='carbon dioxide'


String variables can be set equal to other string variables, e.g.,




String functions are provided to manipulate string variables and to convert them to or from numerical values.


String variables may be passed as arguments to internal  functions, Procedures, Modules and Subprograms and as the first argument for external functions and Procedures.  


In general string variables can be used in EES equations anywhere in which character information is provided.  For example, the name of a fluid provided to a thermophysical property function may be a string variable, e.g.,




A string variable may be used to supply the name of a Lookup file or the name of a column for use with the Interpolate or Lookup commands, e.g.,





A string variable may be used to supply the units of other variables.  For example,



h=15 [U$]


The units could also be set in the Variable Info dialog or by clicking on h in the Solution window.  In any case, EES will recognize that U$ is a string variable and set the units of h to the string that is assigned to U$.


String variables may be used in the Diagram Windowwith an edit box or with a pull-down list of alternatives.  See the Diagram Window for more information.