COPY (BASIC 3.5)
BASIC keyword | |
Keyword: | COPY |
Abbreviation: | C, O, Shift+P |
Type: | Command |
Token code: | BASIC 4.0: 211/$D3 BASIC 3.5 and 7.0: 244/$F4 |
Handling routine in BASIC ROM: |
BASIC 3.5: 51674–51699 $C9DA–$C9F3 BASIC 7.0: 41798–41825 $A346–$A361 |
List of all BASIC keywords |
Remark: This article describes the BASIC command COPY in Commodore BASIC V3.5 or higher.
Type: Command General Programming-Syntax: COPY <source file> [,D<drive number>] TO <destination file> [,D<drive number>,] [[,]ON U<device number>] or COPY D<drive number> TO D<drive number> [[,]ON U<device number>]
COPY is a BASIC 3.5 command that is used to copy a file on a diskette.
It can copy from a disk to another disk in the same drive (on a dual-drive), or a file from a disk in one drive to a disk in another drive, or a file to the same disk (with a different name).
A special use case is a source-file string consisting of at least 2 filenames separated by a comma and a destination which serves two purposes:
- to append: If the destination is the same as the first filename this corresponds to the APPEND command.
- to concatenate: With a distinct destination filename this operation is equivalent with the CONCAT command.
The expression <source file> denotes the string of the source file(s), and expression <destination file> the string with destination file.
Examples[edit | edit source]
Copy the whole disk in drive 1 to the disk in drive 0 (on a dual-drive floppy only):
COPY D1 TO D0
A file from drive 0 (on a dual-drive floppy) to drive 1 with new filename:
COPY D0,"FILE 1" TO D1,"FILE 2"
Creates a duplicate named "STILL SAME DRIVE" from file "SAME DRIVE":
COPY "SAME DRIVE" TO "STILL SAME DRIVE"
Appends file "EXTEND" to the existing file "FILE":
COPY "FILE,EXTEND" TO "FILE"
Concatenates files "F1", "F2", and "F3" to file "ALL":
COPY "F1,F2,F3" TO "ALL"
ABS | ASC | ATN | AUTO | BACKUP | BOX | CHAR | CHR$ | CIRCLE | CLOSE | CLR | CMD | COLLECT | COLOR | CONT | COPY | COS | DATA | DEC | DEF | DELETE | DIM | DIRECTORY | DLOAD | DO | DRAW | DS | DS$ | DSAVE | END | EL | ELSE | ER | ERR$ | EXIT | EXP | FN | FOR | FRE | GET | GET# | GETKEY | GOSUB | GOTO | GRAPHIC | GSHAPE | HEADER | HELP | HEX$ | IF | INPUT | INPUT# | INSTR | INT | JOY | KEY | LEFT$ | LEN | LET | LIST | LOAD | LOCATE | LOG | LOOP | MID$ | MONITOR | NEW | NEXT | ON | OPEN | PAINT | PEEK | POKE | POS | PRINT | PRINT USING | PRINT# | PUDEF | RCLR | RDOT | READ | REM | RENAME | RENUMBER | RESTORE | RESUME | RETURN | RGR | RIGHT$ | RLUM | RND | RUN | SAVE | SCALE | SCNCLR | SCRATCH | SGN | SIN | SOUND | SPC | SQR | SSHAPE | STOP | STR$ | SYS | TAB | TAN | TRAP | TROFF | TRON | UNTIL | USR | VAL | VERIFY | VOL | WHILE | WAIT
ABS | AND | APPEND | ASC | ATN | BACKUP | CATALOG | CHR$ | CLOSE | CLR | CMD | COLLECT | CONCAT | CONT | COPY | COS | DATA | DCLOSE | DEF | DIM | DIRECTORY | DLOAD | DOPEN | DS | DS$ | DSAVE | END | EXP | FN | FOR | FRE | GET | GET# | GO | GOSUB | GOTO | HEADER | IF | INPUT | INPUT# | INT | LEFT$ | LEN | LET | LIST | LOAD | LOG | MID$ | NEW | NEXT | NOT | ON | OPEN | OR | PEEK | POKE | POS | PRINT | PRINT# | READ | READ# | RECORD | REM | RENAME | RESTORE | RETURN | RIGHT$ | RND | RUN | SAVE | SCRATCH | SGN | SIN | SPC | SQR | ST | STEP | STOP | STR$ | SYS | TAB | TAN | THEN | TI | TI$ | TO | USER | VAL | VERIFY | WAIT
ABS | AND | APPEND | ASC | ATN | AUTO | BACKUP | BANK | BEGIN | BEND | BLOAD | BOOT | BOX | BSAVE | BUMP | CATALOG | CHAR | CHR$ | CIRCLE | CLOSE | CLR | CMD | COLLECT | COLLISION | COLOR | CONCAT | CONT | COPY | COS | DATA | DCLEAR | DCLOSE | DEC | DEF FN | DELETE | DIM | DIRECTORY | DLOAD | DO | DOPEN | DRAW | DS | DS$ | DSAVE | DVERIFY | EL | ELSE | END | ENVELOPE | ER | ERR$ | EXIT | EXP | FAST | FETCH | FILTER | FN | FOR | FRE | GET | GET# | GETKEY | GO64 | GOSUB | GOTO | GRAPHIC | GSHAPE | HEADER | HELP | HEX$ | IF | INPUT | INPUT# | INSTR | INT | JOY | KEY | LEFT$ | LEN | LET | LIST | LOAD | LOCATE | LOG | LOOP | MID$ | MONITOR | MOVSPR | NEW | NEXT | NOT | (OFF) | ON | OPEN | OR | PAINT | PEEK | PEN | (PI) | PLAY | POINTER | POKE | POS | POT | PRINT | PRINT USING | PRINT# | PUDEF | (QUIT) | RCLR | RDOT | READ | RECORD | REM | RENAME | RENUMBER | RESTORE | RESUME | RETURN | RGR | RIGHT$ | RND | RREG | RSPCOLOR | RSPPOS | RSPRITE | RUN | RWINDOW | SAVE | SCALE | SCNCLR | SCRATCH | SGN | SIN | SLEEP | SLOW | SOUND | SPC( | SPRCOLOR | SPRDEF | SPRITE | SPRSAV | SQR | SSHAPE | ST | STASH | STEP | STOP | STR$ | SWAP | SYS | TAB( | TAN | TEMPO | THEN | TI | TI$ | TO | TRAP | TROFF | TRON | USR | VAL | VERIFY | VOL | WAIT | WHILE | WINDOW | WIDTH | XOR