#

# LogiView

## Function 'eof'

| Use this function to check if the end of a file that is open for read access has been reached. This function returns the logic value TRUE, if the file does not contain any additional lines. Otherwise the logic value "FALSE" is returned.
| The 'eof' function may be used together with recursive decision table calls or while loops to read a file containing an arbitrary number of lines. The function determines if another (recursive) call or loop must be executed or if the end of file marker has been reached and the file processing can be terminated.
| ### Syntax:
| {LOG_VAR}= eof({INT_VAR})
| ### I/O parameters:
| {INT_VAR} | Integer variable with file ID number (is assigned when opening the file).
| - |
| ### Return value:
| {LOG_VAR} |
TRUE | File does not contain any additional lines.
FALSE | File contains additional lines.
| ### Example:
| Declaration of Variables
     10 C -- Pre-definiton of variables
     20   DOCU_LOGIC_1 = FALSE
     30   DOCU_STRING_1 = "/tmp/test.seite"
     ..
     90 C -- Open file for read access
    100   DOCU_INT_1 = open(DOCU_STRING_1,"r")
    110   DOCU_LOGIC_1  = eof (DOCU_INT_1)
    120 C -- output of line contents until end of file is reached

    130   while (DOCU_LOGIC_1!=TRUE)
    140       readln(DOCU_INT_1,DOCU_STRING_2)
    150       put(DOCU_STRING_2)
    160 C     -- End of file reached?
    170       DOCU_LOGIC_1 = eof (DOCU_INT_1)
    180 C     -- output of "DOCU_LOGIC_1" logic variable
              for better debug mode control
    190       put("EOF=")
    200       put(DOCU_LOGIC_1)
    210    done
    220 C -- close file
    230 close(DOCU_INT_1)
File "test.seite":
    Line 1
    Line 2
    Last line
| Result:
| Functions and commands: File Interface