AssignFile

Belongs to : Procedure

Description

The AssignFile procedure assigns a value to FileHandle for a FileName in preparation for reading or writing to that file.

Version 1

Takes a text file variable type as the handle. The file is treated as a textfile when opened.

If the file name is an empty string, then file access is made to the console standard input and output streams.

Version 2

Takes a binary file variable type as the handle. The file is treated as a binary file.

In both cases, when the file is opened by Append, Reset or ReWrite, it is assumed to be in the current directory.

Notes
The FileHandle must no be confused with the file handle used for the low level file handling routines such as FileOpen and FileRead.




Example code