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

Updated Makefile
author boisy
date Wed, 08 Jan 2003 05:09:53 +0000
parents 3008afb231a2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
1 $TITLE DumpReal
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
2 $SUBTITLE Global Definitions
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
3 PROGRAM dumpreal;
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
4 VAR
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
5 badvar: ^anotherbadvar;
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
6 i : integer;
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
7 hexc : ARRAY[0..15] OF char;
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
8 trix : RECORD
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
9 CASE boolean OF
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
10 true :(r: real);
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
11 false:(c: ARRAY[1..5] OF char)
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
12 END;
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
13 $subtitle Procedure PROCWITHERRORS
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
14 PROCEDURE procwitherrors;
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
15 BEGIN
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
16 this demonstrates what error messages
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
17 look like;
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
18 END;
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
19 $Subtitle Procedure HEXVAL
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
20 PROCEDURE hexval(ch: char);
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
21 BEGIN
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
22 write(hexc[ord(ch) div 16], hexc[ord(ch) mod 16])
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
23 END;
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
24 $SUBtitle M A I N L I N E
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
25 BEGIN
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
26 hexc:='0123456789ABCDEF';
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
27 WHILE true DO
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
28 BEGIN
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
29 write('Enter real number: '); prompt;
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
30 readln(trix.r);
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
31 FOR i:=1 to 5 DO
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
32 BEGIN
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
33 hexval(trix.c[i]);
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
34 write(' ');
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
35 END;
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
36 writeln;
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
37 END
3008afb231a2 Checked in Pascal 2.0
roug
parents:
diff changeset
38 END.