DataMuseum.dk

Presents historical artifacts from the history of:

CP/M

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CP/M

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦8a55597d9⟧ TextFile

    Length: 768 (0x300)
    Types: TextFile
    Names: »CHECK2.PAS«

Derivation

└─⟦092727b26⟧ Bits:30005927 Demoprogrammer til Pascal bog (Jet-80)
    └─ ⟦this⟧ »CHECK2.PAS« 
└─⟦3702e543b⟧ Bits:30003064 Demoprogrammer A-J til Pascal bog
    └─ ⟦this⟧ »CHECK2.PAS« 
└─⟦f983c2ef3⟧ Bits:30004681 Pascal opgaver (Butler)
    └─ ⟦this⟧ »CHECK2.PAS« 

TextFile

PROGRAM check2;
  
  FUNCTION laestal(min, max : INTEGER) : INTEGER;
  
    TYPE
      str5 = STRING(.5.);
    
    VAR
      streng : str5;
      ok : BOOLEAN;
      heltal, test, i : INTEGER;
    
    BEGIN (* laestal *)
      REPEAT
        BUFLEN := 5;
        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»