Skip to content

SeqEOL Global Variable

See Also: Sequential File I/O, Read, ReadLn

Purpose

To indicate that the end of a line has been reached in a sequential data file.

Type

Boolean

What It Does

When a read command encounters an end of line (EOL) character in a sequential input file, it sets SeqEOL to True. The ReadLn command, however, sets SeqEOL to False and allows subsequent Read commands to function.

String sElement
Direct_Input "Aircraft.txt"
Repeat
    Repeat
        Read sElement
        Show sElement ", "
    Until (SeqEOL)
    ReadLn
    ShowLn
Until (SeqEOF)

In this example, the input file Aircraft.txt is opened, and delimited data items are read into the string variable sElement and shown on the screen. When an end of line marker is detected, the repeat ... until loop terminates, and the ReadLn command discards the EOL and sets SeqEOL to False. The ShowLn command outputs a carriage return/line feed to the screen, and execution loops back to the next line of input data.

Notes

  • Never rely on the value of the SeqEOL indicator other than on the line immediately following the line of code that sets it. Many different commands and messages alter the value of SeqEOL and other global indicators.

  • ReadLn always reads to and including the end of line (EOL) character, and sets SeqEOL to False.

  • Without ReadLn, Read commands cannot read past an EOL.

  • Different operating systems indicate EOL in different ways. DataFlex interprets EOL in whatever way it is indicated in the host operating system and sets SeqEOL so that the condition may be dealt with in a single program whose commands are not operating system dependent.

  • Read_Block does not respect end-of-line markers.