dsaa32
dsaa32
22 penup
23 goto
24 150
25 40
26 1
27 black
28 pendown
29 beginfill
30 yellow
31 goto
32 30
33 40
34 1
35 black
36 goto
37 30
38 70
39 1
40 black
41 goto
42 60
43 70
44 1
45 black
46 goto
47 60
48 100
49 1
50 black
51 goto
52 90
53 100
54 1
55 black
56 goto
57 115
58 70
59 1
60 black
61 goto
62 150
63 70
64 1
65 black
66 goto
67 150
68 40
69 1
70 black
71 endfill
Listing 1.14 A Text File with Multiple Line Records
To read a file as shown in Listing 1.14 we write our loop and a half to read the
first line of each record and then check that line (i.e. the graphics command) so we
know how many more lines to read. The code in Listing 1.15 uses a while loop to
read these variable length records.