AssignFile function
Prototype: |
function AssignFile(const filename: string): integer; |
|
Description: |
The AssignFile function assigns a filename (existing or new) to an integer identifier which is then used as the file reference. |
|
Syntax: |
AssignFile(FileName); |
|
Part |
Description |
|
FileName |
The file name (existing or new) as a string |
|
Return value: |
Integer identifier of the file used as its handle for the rest of file-related functions. |
|
Example:
var
fileID: integer;
fileName: string;
begin
fileName:= 'listOfTrees.txt';
fileID:= AssignFile(fileName);
CloseFile(fileID);
end.
See also:
AssignFile; Reset; Rewrite; Append; WriteLn; ReadLn; EOF; CloseFile; DeleteFile; SaveStringToFile; SaveStringToFileAsUTF8
© 2024 IFER-Monitoring and Mapping Solutions