Cicode Programming Reference > Cicode Function Categories > File Functions Introduction > FileRead

FileRead

Reads a number of characters from a file. The string can contain less characters than requested if the end of file is reached. A maximum of 255 characters can be read in each call.

Syntax

FileRead(File, Length)

File:

The file number.

Length:

The number of characters to read.

Return Value

The text from the file (as a string).

Related Functions

FileOpen, FileClose, FileReadLn

Example

WHILE NOT FileEOF(File) DO
Str=FileRead(File,20);
END

See Also

File Functions