next up previous contents index
Next: Blockread Up: Functions and Procedures Previous: Arctan

Assign

   

Declaration:

Procedure Assign (Var F; Name : String) ;

Description:

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.

Errors:

None.

See also:

Reset, Rewrite, Append

Example
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.



Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998