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

WriteStr

Write variables to a string

Declaration

Source position: system.fpd line 60

procedure WriteStr(

  out S: String;

  Args: Arguments

);

Description

WriteStr behaves like Write, except that it stores its output in the string variable S instead of a file. Semantically, the WriteStr call is equivalent to writing the arguments to a file using the Write call, and then reading them into S using the Read call from the same file:

var
  F : Text;
begin
  Rewrite(F);
  Write(F,Args);
  Close(F);
  Reset(F);
  Read(F,S);
  Close(F);
end;  

Obviously, the WriteStr call does not use a temporary file.

WriteStr is defined in the ISO Extended Pascal standard. More information on the allowed arguments and the possible formatting can be found in the description of Write.

See also

Write

  

Write variable to a text file

ReadStr

  

Read variables from a string

Read

  

Read from a text file into variable

The latest version of this document can be found at lazarus-ccr.sourceforge.net.