FileWrite

Top  Previous  Next

Prototype

 

FileWrite (intFileHandle, intByte)

 

Description

 

Writes one byte inside one file.

 

Parameters

 

IntFileHandle: integer value that corresponds at the handle of the file.

 

IntByte : integer value between 0 and 255.

 

Returned value

 

None.

 

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);