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

⟦6de6a67dd⟧ TextFile

    Length: 1792 (0x700)
    Types: TextFile
    Names: »CHECK1.PAS«

Derivation

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

TextFile

      PROGRAM check1;
        
        CONST
          maxtegn = 10;
          
        TYPE
          cifre = 0 .. 9;
          vektor = ARRAY(.1 .. maxtegn.) OF cifre;
          cifferstreng = STRING(.maxtegn.);
        
        VAR
          i, position : INTEGER;
          v : vektor;
          cstreng : cifferstreng;
          retur : CHAR;
          
        BEGIN
          REPEAT
            WRITE(CLRHOM);
            GOTOXY(10, 5);
            WRITE('Indtast et helt tal på ', maxtegn, ' cifre.');
            GOTOXY(10, 7);
            WRITE('Tast tallet her: <');
            FOR i := 1 TO maxtegn DO
              WRITE(' ');
            WRITE('>');
            BUFLEN := maxtegn;
            GOTOXY(28, 7);
            READLN(cstreng);
            position := 0;
            FOR i := LEN(cstreng) TO maxtegn DO
              cstreng := cstreng + ' ';
            FOR i := maxtegn DOWNTO 1 DO
              IF (cstreng(.i.) < '0') OR (cstreng(.i.) > '9')
                THEN position := i;
            IF position > 0               (* Fejlagtigt tegn fundet *)
              THEN 
                BEGIN
                  GOTOXY(27 + position, 8);
                  WRITE('^');
                  GOTOXY(27 + position, 9);
                  WRITE('Fejlagtigt tegn - Tast <RETURN>');
                  READLN(retur);
                END;
          UNTIL position = 0;
          GOTOXY(10, 9);
          WRITE('Cifrene er: ');
          FOR i := 1 TO maxtegn DO
            BEGIN
              v(.i.) := ORD(cstreng(.i.)) - ORD('0');
              WRITE(v(.i.) : 2);
            END;
          WRITELN;
        END.
«eof»