|
|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 768 (0x300)
Types: TextFile
Names: »CHECK2.PAS«
└─⟦08ea08c61⟧ Bits:30003924 PolyPascal programmer
└─⟦this⟧ »CHECK2.PAS«
PROGRAM check2;
FUNCTION laestal(min, max : INTEGER) : INTEGER;
TYPE
str = STRING(.3.);
VAR
streng : str;
ok : BOOLEAN;
heltal, test, i : INTEGER;
BEGIN (* laestal *)
REPEAT
BUFLEN := 3;
READ(streng);
VAL(streng, heltal, test);
ok := (test = 0) AND (min <= heltal) AND (heltal <= max);
IF NOT ok (* slet svaret *)
THEN
FOR i := 1 TO LEN(streng) DO
WRITE(CHR(8), ' ', CHR(8));
UNTIL ok;
WRITELN;
laestal := heltal;
END; (* laestal *)
BEGIN (* check2 *)
WRITE('Tast et tal fra 10 til 500: ');
WRITELN(laestal(10, 500));
END. (* check2 *)
«eof»