The assign procedure
The assign procedure names a
file variable. NOTE: You can't use this function
to rename a file, use the built-in procedure rename
if you want to do that.
The name of a file variable controls which file is opened when
the file variable is opened. If the name is a non-empty
string then a file with that name is opened. If the name is an empty string then the file
opened is either the standard output file, or a temporary file (with a system generated name),
depending on the project options set when the program was compiled.
- The first parameter is a reference to the file variable
to be named.
- The second parameter is an expression of
string type or char type,
and is the new name of the file variable.
For example to open a file named 'README.TXT' for reading you could use.
where f is a reference to a file variable.
Operating Systems: All
Standard Pascal: No