PROGRAM   CharTb34 ;
{$APPTYPE CONSOLE}

{
!---------------
! Write Char table
!---------------
}
CONST
   C_HexCh : String[16] = '0123456789ABCDEF' ;

VAR
   G_i : Integer ;

   G_j    : Integer ;
   G_Code : Byte ;

BEGIN
   WriteLn (   '          0 1 2 3 4 5 6 7 8 9 A B C D E F'   );
   WriteLn (   '          -------------------------------'   );

   {----- LOOP 1 }
   FOR G_i := 0 TO 15 DO BEGIN
      {----- Line address (in decimal) and in hexa }
      Write (   '('  ,  (G_i*16):3  ,  ') '   );
      Write (   C_HexCh[G_i+1]  ,  '0>'   );

      {----- LOOP 2 }
      FOR G_j := 0 TO 15 DO BEGIN
         G_Code := G_i*16  +  G_j ;

         Write (   ' '   );

         {----- Write char  ( Ignoring problem chars )  }
         CASE G_Code OF
            $00 : Write (   '-'   );      {--- EOF   End Of File     }
            $07 : Write (   '-'   );      {--- BEL   Bell            }
            $08 : Write (   '-'   );      {--- BS    Backspace       }
            $09 : Write (   '-'   );      {--- HT    Tabulation      }
            $0A : Write (   '-'   );      {--- LF    Line Feed       }
            $0D : Write (   '-'   );      {--- CR    Carriage Return }
            $1A : Write (   '-'   );      {--- ??                    }
            ELSE
               Write (   Chr(G_Code)   );
         END;{case}
      END;{j}

      WriteLn ;
   END;{i}
END.
