FileOpen

Top  Previous  Next

Prototype

 

IntFileHandle:=FileOpen (FileName)

 

Description

 

Opens a file in binary mode and it returns the correspondent handle.

 

Parameters

 

FileName: A string containing a valid path and filename.

 

Returned value

 

IntFileHandle: integer value corresponding to the file handle .

 

Notes

 

The returned handle can be used as parameter in those functions that work on the files (FileClose, FileRead, …).

 

Example

 

// Check if there is a file within the directory

bExists:=FileExists ('c:\file.dat');

 

// Create a file if it doesn't exist

If bExists=False Then CreateFile('c:\file.dat');

 

// Open the file

strFile:=FileOpen('c:\file.dat');

 

// Execute other operations

 

// Close the file

FileClose(strFile);