Previous: Write procedure To the Table of Content Next: TlHelp32 Unit

- 4.62.2.99 -
Standard Units
System Unit
System Unit Procedures and Functions

WriteLn procedure

Targets: MS-DOS, OS/2, Win32

System Unit

Executes the Write procedure, then outputs an end-of-line marker to the file.

Declaration:
procedure Writeln([ var F: Text;] P1 [, P2, ...,Pn ] );
Remarks:
F, if specified, is a file variable. If omitted Output is assumed. P1 may be of char, string, integer, real, or Boolean type. P1 through Pn are output to F. Each P parameter may be formatted as follows:
  P [:MinWidth [:Decimals]]
where P is the value to output. MinWidth, which must be greater than zero, specifies the minimum width of P. Decimals specifies the number of decimal places to be output when P is of real type.

The file used by WriteLn must be open for output. An end of line marker is written to F after output.

Example:
{$ifndef __CON__}
  This program must be compiled as console application only
{ $endif}
var  
  Name: String;
  Age:  DWORD;
begin
  Write('Enter your name: ');
  ReadLn(Name);
  Write('Enter your age : ');
  ReadLn(Age);
  if Age < 21 then 
    WriteLn('You ''re so young, ', Name, '!')
  else if Age < 40 then 
    WriteLn(Name, ', you''re still in your prime!')
  else if Age < 60 then 
    WriteLn('You''re over the hill, ', Name, '!')
  else if Age < 80 then 
    WriteLn('I bow to your wisdom, ', Name, '!')
  else
    Writeln('Are you really ', Age, ', ', Name, '?');
end.
See also:
__writer


Previous: Write procedure To the Table of Content Next: TlHelp32 Unit
Write procedure Table of Content TlHelp32 Unit

- 4.62.2.99 -