Click here to return to the KiXtart HelpDesk main page...

KiXtart Command Reference

READLINE

action

Reads a line from a file.

syntax

READLINE (file number)

parameter

File number

A numeric expression indicating the file number of the file to open. Possible values range from 1 to 10.

remarks

READLINE reads a string ending in a carriage return. If successful, the function returns the string without a carriage return. If it encounters an error, @ERROR returns an error code.

returns

-4

File not open for reading

-3

File number not open

-2

Invalid file number specified

-1

End of file

0

Line read successfully

example

IF Open(3, @LDRIVE + "\CONFIG\SETTINGS.INI")  = 0

$x = ReadLine(3)

WHILE @ERROR = 0

? "Line read: [" + $x + "]"

$x = ReadLine(3)

LOOP

Close (3)

ELSE

BEEP

? "Config file not opened, error code: [" + @ERROR + "]"

ENDIF