help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Procedures and functions][Variables] Reference for unit 'objpas' (#rtl)

AssignFile

Assign text or untyped file

Declaration

Source position: line 0

procedure AssignFile(

  var f: file;

  const Name: String

);

procedure AssignFile(

  var f: file;

  p: pchar

);

procedure AssignFile(

  var f: file;

  c: Char

);

procedure AssignFile(

  var t: Text;

  const s: String

);

procedure AssignFile(

  var t: Text;

  p: pchar

);

procedure AssignFile(

  var t: Text;

  c: Char

);

procedure AssignFile(

  var f: TypedFile;

  const Name: String

);

procedure AssignFile(

  var f: TypedFile;

  p: pchar

);

procedure AssignFile(

  var f: TypedFile;

  c: Char

);

Description

AssignFile is completely equivalent to the system unit's Assign function: It assigns Name to a function of any type (FileType can be Text or a typed or untyped File variable). Name can be a string, a single character or a PChar.

It is most likely introduced to avoid confusion between the regular Assign function and the Assign method of TPersistent in the Delphi VCL.

Errors

None.

See also

CloseFile

  

Close text or untyped file

#rtl.system.Assign

  

Assign a name to a file

#rtl.system.Reset

  

Open file for reading

#rtl.system.Rewrite

  

Open file for writing

#rtl.system.Append

  

Open a file in append mode

Example

Program Example88;

{ Program to demonstrate the AssignFile and CloseFile functions. }

{$MODE Delphi}

Var F : text;

begin
  AssignFile(F,'textfile.tmp');
  Rewrite(F);
  Writeln (F,'This is a silly example of AssignFile and CloseFile.');
  CloseFile(F);
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505