DataMuseum.dk

Presents historical artifacts from the history of:

Bogika Butler

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

See our Wiki for more about Bogika Butler

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦d8860e7ae⟧ TextFile

    Length: 1024 (0x400)
    Types: TextFile
    Names: »FILKOPI.PAS«

Derivation

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

TextFile

PROGRAM filkopi;

  TYPE
    buffertype = ARRAY(.1 .. 12800.) OF CHAR;
    str14 = STRING(.14.);
    
  VAR
    buffer : buffertype;
    indnavn, udnavn : str14;
    indfil, udfil : FILE;
    i, laengde : INTEGER;
    
  BEGIN
    WRITE(CLRHOM);
    WRITE('Hvilken fil skal kopieres: '); READLN(indnavn);
    WRITE('Hvad skal kopien hedde: '); READLN(udnavn);
    ASSIGN(indfil, indnavn);
    ASSIGN(udfil, udnavn);
    RESET(indfil);
    REWRITE(udfil);
    laengde := LENGTH(indfil);
    i := 0;
    IF laengde >= 100 
      THEN
        BEGIN
          REPEAT
            BLOCKREAD(indfil, buffer, 100);
            BLOCKWRITE(udfil, buffer, 100);
            i := i + 100;
          UNTIL (laengde - i) < 100;
        END;
    IF (laengde - i) > 0
      THEN
        BEGIN
          BLOCKREAD(indfil, buffer, laengde - i);
          BLOCKWRITE(udfil, buffer, laengde - i);
        END;
    CLOSE(indfil);
    CLOSE(udfil);
  END.
«eof»