READNEXT_LOCALE

Reads data from an existing text file opened for reading by the OPEN command.

Syntax:

READNEXT_LOCALE x
READNEXT_LOCALE x, y
READNEXT_LOCALE x,y,z,a,b,c,q
 

Discussion:

READNEXT_LOCALE is almost identical to READ_LOCALE. The key difference is READ_LOCALE will read the entire data line from the opened file, up to the newline character, while READNEXT reads only enough characters to fill the number of arguments.

For example, if a data file contains a line with this data:

3.0 4.0 5.0

The following two READNEXT_LOCALE commands will read the values 3.0, 4.0, and 5.0 for x, y, and z:

READNEXT_LOCALE x, y
READNEXT_LOCALE z

READNEXT_LOCALE is more useful than READ_LOCALE or READ if the line is very long, or the number of arguments is large. READNEXT_LOCALE does not support array variable names as arguments. The workaround is to read the data into a scalar variable and then set the array variable to the scalar variable value in a subsequent line like this:

READNEXT_LOCALE x 
data(i, j) = x

Example:

OPEN "C:\DATA\TEST.DAT" 
READNEXT_LOCALE x1, x2
READNEXT_LOCALE x3
CLOSE

Related Keywords:

OPEN, CLOSE, READ, READ_LOCALE, READNEXT, READSKIP, READSTRING

Next: