COPYFILE [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Reference Manual
COPYFILE
The COPYFILE statement copies one file to another file or to a device
referenced by a file operation. It does not affect the original file.
Syntax
[ {,} ]
COPYFILE fname1 [TO fname2] [, lock_word {;} STATUS[=]num_var]
Parameters
fname1 fname of the file to be copied.
fname2 fname of the copy of the file that is to be created.
The name must not be the name of a file that already
exists, otherwise a duplicate file name error occurs.
The COPYFILE statement creates a file with this name and
gives it the attributes of the original file. If this
parameter is not specified, the COPYFILE statement
copies the original file to the standard list device or
to the device specified by the most recently executed
SEND OUTPUT TO statement.
Similar to the formal_designator described in the Device
Specification Syntax in chapter 6, fname2 can also be
one of "$STDLIST", "$NULL" or "*fname". The *fname
syntax is used to reference device files that have been
previously defined using file equations.
lock_word String expression that evaluates to the lockword for
fname1. It is required if fname1 has a lockword.
The lockword is not added to the copied file.
num_var The COPYFILE statement assigns zero to num_var if the
copy is completed successfully; otherwise, the value is
set to a nonzero value.
Examples
100 CREATE ASCII "File1", RECSIZE=100, FILESIZE=1200
120 CREATE ASCII "File3", RECSIZE=100, FILESIZE=2400
130 PROTECT "File1", "zzxyz" !add lockword "zzxyz" to File1
140 PROTECT "File3", "pqpqqp" !add lockword "pqpqqp" to File3
150 COPYFILE "File1" TO "File2", "zzxyz" !lockword required for access
155 !to File1 - File2 is created
160 COPYFILE "File2" TO "File4" !File2 has no lockword.
170 COPYFILE "File2" TO "File6"
180 COPYFILE "File2" !displays the contents of File2
185 !on the terminal display
190 SEND OUTPUT TO "File5"
200 COPYFILE "File2" !writes the contents of File2
999 END !to File5
10 COPYFILE "File1/Lock1" TO "File2" !File2 does not have a lockword
20 COPYFILE "File3" TO "File4", "Lock3" !File4 does not have a lockword
100 SYSTEM "FILE LINE; DEV=LP"
120 SYSTEM "FILE LASER; DEV=PP,8;ENV=LP602.ENV2680A.SYS;CCTL"
140 COPYFILE TEXT TO "*LASER"
160 COPYFILE WORK TO "*LINE"
MPE/iX 5.0 Documentation