Previous: 4.67.2.98. Write procedure To the Table of Contents Next: 4.68. TlHelp32 - Tool help unit
4.67.2.98. Write procedure Table of Contents 4.68. TlHelp32 - Tool help unit

- 4.67.2.99. -
Table of Contents
4. Standard Units
4.67. System - Built-in routines
4.67.2. System Unit Procedures and Functions
4.67.2.99. WriteLn procedure


4.67.2.99. 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: 4.67.2.98. Write procedure To the Table of Contents Next: 4.68. TlHelp32 - Tool help unit
4.67.2.98. Write procedure Table of Contents 4.68. TlHelp32 - Tool help unit

- 4.67.2.99. -