ReadX

Description:              This statement reads numeric data from a text file into the elements of an array.

Returns:                    Array

Usage:                       Script

Format:                      ReadX(ArrayElem, N, File)

Parameters:             ArrayElem  { array element }  { required }  { no default: }

                                      Any array element giving the starting point in the array in which to store the data. The subscript for the array may be any numeric expression. Unless specified, the lowest dimension of a multidimensional array is used. The array may be either statically declared or dynamically allocated.

                                    N  { numeric }  { required }  { no default: }

                                      Any numeric expression giving the number of array elements to read starting at the element given by the first parameter. If N extends past the upper bound of the lowest array dimension, this computation will "wrap-around" and resume at element 0, until N elements have been processed.

                                    File  { text }  { required }  { no default: }

                                      A text expression giving the file name of the data file; it should be enclosed in double quotes if it is a constant.

Comments:               The data should be stored in the file with one numeric value per line. If more than one value exists on a line, if the line is left blank, or if it contains a non-numeric character, the corresponding element in the array will be set to invalid. If the file contains fewer than N values, the remaining values will also be invalid.

                             This statement is useful for importing data from other databases into VTS.

Example:

If MatchKeys(1, "G");

[

  ReadX(chlorineCon[0] { Starting point in array }, 

        30 { Number of elements to read }, 

        "CHLORINE.TXT" { File from which to read data }); 

]

This reads 30 numbers from the text file called CHLORINE.TXT into elements 0 to 29 of chlorineCon when a capital G is pressed on the keyboard.

See Also:

FRead | SRead | ReadXY