COPY (BASIC 3.5)
|Abbreviation:||C, O, Shift+P|
|Token code:||BASIC 4.0:|
BASIC 3.5 and 7.0:
in BASIC ROM:
|BASIC 3.5: |
|List of all BASIC keywords|
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"