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

⟦525957f5e⟧ TextFile

    Length: 1408 (0x580)
    Types: TextFile
    Names: »CPRDATO.PAS«

Derivation

└─⟦f983c2ef3⟧ Bits:30004681 Pascal opgaver (Butler)
    └─⟦this⟧ »CPRDATO.PAS« 

TextFile

 is started. When it ends, it automatically transfers control to
the command mode.

If a run time error occurs, the program will terminate displaying a run time
error message, for instance:

        EXECUTION ERROR 04 AT PC=254E
        Program terminated

You may then use the FIND command to locate the statement that caused the
error (see 'HELP FIND' text).

%PCOMPAS ON-LINE HELP: The PROGRAM command.

The PROGRAM command is used to compile the program into a command file on a
disk. The commPROGRAM cprdato2;

  TYPE
    str6 = STRING(.6.);
    arr = ARRAY(.1 .. 6.) OF INTEGER;
    
  VAR
    str : str6;
    cif : arr;
    g, h, i, datosum, gsum, hsum, isum, check, j : INTEGER;
    dag, maaned, aar : INTEGER;
    ok : BOOLEAN;
    
  BEGIN
    WRITE(CLRHOM);
    REPEAT
      REPEAT
        GOTOXY(10, 5);
        WRITE('Indtast en dato således: DDMMÅÅ');
        GOTOXY(35, 6);
        WRITE(CLREOL);
        BUFLEN := 6;
        READLN(str);
        ok := TRUE;
        IF LEN(str) < 6
          THEN ok := FALSE
          ELSE
            FOR j := 1 TO 6 DO
              IF (str(.j.) < '0') OR ('9' < str(.j.))
                THEN ok := FALSE;
      UNTIL ok;
      FOR j := 1 TO 6 DO
        cif(.j.) := ORD(str(.j.)) - ORD('0');
      dag := cif(.1.) * 10 + cif(.2.);
      maaned := cif(.3.) * 10 + cif(.4.);
      aar := cif(.5.) * 10 + ci