| [Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | 
Assign a name to a file
Source position: systemh.inc line 1168
| procedure Assign( | 
| out f: file; | 
| const Name: ShortString | 
| ); | 
| out f: file; | 
| const p: PAnsiChar | 
| ); | 
| out f: file; | 
| const c: AnsiChar | 
| ); | 
| out f: file; | 
| const Name: UnicodeString | 
| ); | 
| out f: file; | 
| const Name: RawByteString | 
| ); | 
| out f: TypedFile; | 
| const Name: shortstring | 
| ); | 
| out f: TypedFile; | 
| const p: PAnsiChar | 
| ); | 
| out f: TypedFile; | 
| const c: AnsiChar | 
| ); | 
| out f: TypedFile; | 
| const Name: unicodestring | 
| ); | 
| out f: TypedFile; | 
| const Name: RawByteString | 
| ); | 
| out t: Text; | 
| const s: shortstring | 
| ); | 
| out t: Text; | 
| const p: PAnsiChar | 
| ); | 
| out t: Text; | 
| const c: AnsiChar | 
| ); | 
| out t: Text; | 
| const s: unicodestring | 
| ); | 
| out t: Text; | 
| const s: RawByteString | 
| ); | 
Assign assigns a name to F, which can be any file type. This call doesn't open the file, it just assigns a name to a file variable, and marks the file as closed.
None.
| 
 | Open file for reading | |
| 
 | Open file for writing | |
| 
 | Open a file in append mode | 
Program Example5; { Program to demonstrate the Assign function. } Var F : text; begin Assign (F,''); Rewrite (f); { The following can be put in any file by redirecting it from the command line.} Writeln (f,'This goes to standard output !'); Close (f); Assign (F,'Test.txt'); rewrite (f); writeln (f,'This doesn''t go to standard output !'); close (f); end.