|
|
DataMuseum.dkPresents historical artifacts from the history of: Bogika Butler |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Bogika Butler Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 1536 (0x600)
Types: TextFile
Names: »FIGURES.PAS«
└─⟦314366c8f⟧ Bits:30009789/_.ft.Ibm2.50006598.imd Mogens Pelles Zilog 80,000 / EOS projekt
└─⟦this⟧ »FIGURES.PAS«
└─⟦977c9bad1⟧ Bits:30009789/_.ft.Ibm2.50006590.imd Mogens Pelles Zilog 80,000 / EOS projekt
└─⟦this⟧ »FIGURES.PAS«
PROGRAM figures (input,output);
æThis is a short program to illustrate random-access
reading from a file. A workfile is written with the
values 'zero' to 'nineteen' in character form in the
appropriate records; the file is then reset, and is
accessed to retrieve the records randomly on request.å
TYPE string12 = stringÆ12Å;
VAR wf: FILE OF string12;
PROCEDURE writefile;
PROCEDURE writewf (fstr: string12);
BEGIN
write (wf,fstr);
END;
BEGIN
writewf ('zero'); writewf ('one'); writewf ('two');
writewf ('three'); writewf ('four'); writewf ('five');
writewf ('six'); writewf ('seven'); writewf ('eight');
writewf ('nine'); writewf ('ten'); writewf ('eleven');
writewf ('twelve'); writewf ('thirteen');
writewf ('fourteen'); writewf ('fifteen');
writewf ('sixteen'); writewf ('seventeen');
writewf ('eighteen'); writewf ('nineteen');
END æwritefileå;
PROCEDURE access;
VAR num: integer; exit: boolean;
BEGIN
exit := false;
REPEAT
write ('Which number (0 to 19) - '); readln (num);
IF num < 0 THEN exit := true
ELSE
IF num > 19 THEN writeln ('Out of range')
ELSE
BEGIN
seek (wf,num); writeln (wf^:28);
END;
UNTIL exit;
END æaccesså;
BEGIN
rewrite (wf);
writefile;
reset (wf);
access;
END.
«eof»