Overview | Statement List


阅读文本

Synopsis

READ/file#[,LINNO,line#][,USING,'image string'][,IFEND,label:][,IFERR,label:,],variable list

Description

The following statement reads a line of data from the specified scratch file. An unformatted READ of a string will discard leading blanks. A formatted READ of a string will retain leading blanks. Unless the program changes line numbers using the RESEQ statement, all line numbers are in increments of 10.

Parameters

Parameter

Description

file#

The number of the scratch file from which the data is to be read. Ten scratch file areas are available, therefore, the specified number must be between 1 and 10.

LINNO

Minor word which indicates that a specified line is to be read.

NOTE: If LINNO is not specified the line following the line pointer position in the data file will be read and the line pointer will be set to the last line read. You can set the line pointer to the top of the file buffer with the RESET command.

line#

The number of the line to be read.

USING

Minor word which indicates that the data is to be input to a specified format.

NOTE: The USING option should be used only when the data in the file is in a free format.

'image string'

The format image string which was covered in the beginning of this section.

IFEND,label:

Specifies a label to which the program jumps when the pointer reaches the end of the file.

IFERR,label:

Specifies a label to which the program jumps if an error occurs.

variable list

The variable list may consist of any combination of string variables or numerical variables.

NOTE: If the number of items in the data record exceed the number of variables in the variable list, the remaining items will be ignored. If the number of variables in the variable list exceed the number of items in the data record, subsequent lines of data will read until the variable list has been satisfied.

The variable list may contain a maximum of 42 variables and/or array positions. However, the line length is limited to 132 characters. If this length is exceeded, the remaining characters are ignored.

 


Copyright ©2015 胡君NX二次开发官网(www.UGapi.com) QQ:85585969 All Rights Reserved.