qp.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
asciitbl.PAS
  Example Contents Index                                    Back
 
PROGRAM asciitbl;
 
{ Program asciitbl prints an ASCII table. It demonstrates the
  following function:
 
      Chr
 
  It also uses the MOD operator.
 
  This program uses the Crt unit for faster output and to avoid DOS
  interpretation of the characters. This guarantees the display of the
  maximum number of printable characters.
}
 
USES
    Crt;
 
CONST
    program_name = 'ASCIITBL ';
    program_desc = 'displays an ASCII table.';
 
VAR
    i : Byte;
 
BEGIN
 
    Writeln( program_name, program_desc );
    Writeln;
 
    Writeln( 'ASCII Table' );
    FOR i := 1 TO 255 DO
        BEGIN
        CASE i OF
            7  : Write( i:3, ' BELL', '    ' );
            8  : Write( i:3, ' BKSP', '    ' );
            10 : Write( i:3, '   LF', '    ' );
            13 : Write( i:3, '  RET', '    ' );
            ELSE Write( i:3, Chr( i ):5, '    ' );
            END; { case }
        IF ((i MOD 5) = 0) THEN Writeln;
        END;
 
END.