view 3rdparty/packages/pascal/Dumpreal @ 749:ec1909ff0764

Updated Makefile
author boisy
date Wed, 08 Jan 2003 05:09:53 +0000
parents 3008afb231a2
children
line wrap: on
line source

$TITLE DumpReal 
$SUBTITLE Global Definitions
PROGRAM dumpreal;
VAR
   badvar: ^anotherbadvar;
   i : integer;
   hexc : ARRAY[0..15] OF char;
   trix : RECORD
          CASE boolean OF
             true :(r: real);
             false:(c: ARRAY[1..5] OF char)
          END;
$subtitle Procedure PROCWITHERRORS
PROCEDURE procwitherrors;
BEGIN
   this demonstrates what error messages
   look like;
   END;
$Subtitle Procedure HEXVAL
PROCEDURE hexval(ch: char);
   BEGIN
   write(hexc[ord(ch) div 16], hexc[ord(ch) mod 16])
   END;
$SUBtitle M A I N L I N E
BEGIN
hexc:='0123456789ABCDEF';
WHILE true DO
   BEGIN
   write('Enter real number: '); prompt; 
   readln(trix.r);
   FOR i:=1 to 5 DO
      BEGIN
      hexval(trix.c[i]);
      write(' ');
      END;
   writeln;
   END
END.