FileRead

Top  Previous  Next

Prototype

 

IntByte:=FileRead (intFileHandle)

 

Description

 

Reads a byte from file.

 

Parameters

 

IntFileHandle: integer value corresponding to the file handle.

 

Returned value

 

IntByte : integer value between 0 and 255.

 

Notes

 

None.

 

Example

 

// Open the file

FirstFile:=FileOpen('c:\files\file');

 

// Open another file

SecondFile:=FileOpen('c:\files\SecondFile');

 

// position a locator in the first file

FileSeek(FirstFile, 1);

 

// Read a byte from the first file

ByteRead:=FileRead(FirstFile);

 

// position a locator in the second file

FileSeek(SecondFile, 1);

 

// Write a byte in the second file

FileWrite(SecondFile,ByteRead);

 

// Close the first file

FileClose(FirstFile);

 

// Close the second file

FileClose(SecondFile);