<<

Contents

Search

>>

 

PROCESS_SEQ_FILE

 

 

Function

 

 

Syntax:

PROCESS_SEQ_FILE(<Filename>,<Macroname>)

 

<Filename>

= <STRING-EXPRESSION >

<Macroname>

= <MACRONAME>

 

 

Meaning:

Processes a sequential file.

 

PROCESS_SEQ_FILE opens a sequential file with OPEN INPUT, reads the lines with LINE INPUT and closes the file. After each successful read of a line the macro <Macroname> is executed. The variable EBUS_SEQ_FILE_LINE$ contains the line which had been read.

 

The variable EBUS_DATA is set = 1 before the macro is startet. If  EBUS_DATA = 0 when the macro has finised, the processing is aborted.

 

PROCESS_SEQ_FILE returns the following results:

 

Result

Meaning

0

No error. The sequential file has been completely processed.

-1

An error occured.

-2

The processing has been aborted by EBUS_DATA = 0.

-3

<Filename> is empty.

 

Parameter:

Filename

Name sequential file

Macroname

Name of the macro which is called after a line has been read.

 

Sample:

// Read and print all lines of "Test.dat"

 

H% = PROCESS_SEQ_FILE("Test.dat",TEST.PROCESS.LINE)

IF H% <> 0

THEN ERRORMES = "Error " + STR$(H%)

ENDIF

 

// Macro TEST.PROCESS.LINE

LRPINT EBUS_SEQ_FILE_LINE$

 

See also:

EBUS_SEQ_FILE_LINE$

EBUS_DATA

OPEN INPUT

LINE INPUT

GET_FILECONTENT$