Read
General Action Statement
The Read statement takes the next numeric value from a Read file and assigns that value to a name. Read files are defined in the External Files panel. For more information, see External Files.
Syntax
Read <file ID>, <name>
Example
Read File1, Var1
Parameters
<fileID>
The name of the file as defined in the External Files panel.
<name>
The Variable or Attribute to be assigned the value.
Remarks
When reading from a file, ProModel skips all non-numeric data, such as text, and reads the next numeric value. Thus, comments and notes may be included in a Read file.
Multiple replications of a model continues reading from a file where the previous replication left off unless the Reset statement is used.
ProModel reads a period (.) in a Read file as a zero. To avoid this, use the comment symbol (//) in front of notes and comments that contain a period.
Read can read ASCII files. Most spreadsheet programs can convert spreadsheets to ASCII files (.txt) and comma-delimited files (.csv).
If a Read statement is not assigning the right values to the proper name, there may be numeric information in the read-file's header information (notes and comments). Additionally, if the values are being read into an array, the array indices may not be incremented properly between reads.
If a read file must be read more than once in a model, it may need to be reset. One way to tell when a file needs to be reset is with an end of file marker, such as 9999, and the following two lines of logic.
Read File1,Value
If Value= 9999 Then Reset File1