Skip to content

Read_Line

Include: Use System\FileSystem.pkg

See Also: Direct_Input, Read, Read_Block, Read_Hex, SeqEOF, SeqEOL, Write_Line, Sequential Channels

Purpose

Reads a whole line from a sequential input file.

Syntax

Read_Line [Channel {ChannelNumber}] [{Variable}] ...

Behavior

Read_Line reads through the current line terminator and assigns the line text without the terminator into the destination. Normal DataFlex conversion handles scalar destinations.

The current line terminator comes from the open command. Read_Line supports the pc-text:, cr:, and eol: file-name options supplied to Direct_Input.

Use Seq_New_Channel when opening files in application code; see Sequential Channels.

Example

Handle hFile
String sLine

Get Seq_New_Channel to hFile
Direct_Input Channel hFile FILE "test1.txt"
Read_Line Channel hFile sLine
Close_Input Channel hFile
Send Seq_Release_Channel hFile