BCOPY statement
Purpose: BCOPY does a binary copy from one object to another object of equal size. BCOPY will copy objects with embedded NULLs.
Syntax: BCOPY binobject1 TO binobject2 Parameters:
|
Example:
DIMInBin$DIMLenInBin% InBin$=APPEXEPATH$&"bcx.jpg"OPENInBin$FORBINARYASfp1 LenInBin%=LOF(InBin$)DIMwork$*LenInBin%"File length is: "; LenInBin%GET$fp1, work$, LenInBin%CLOSEfp1DIMnewbin$*LenInBin%'new string same length as binary data in work$BCOPYwork$TOnewbin$DIMOutBin$ OutBin$=APPEXEPATH$&"bcx2.jpg"OPENOutBin$FORBINARYNEWASfp1PUT$fp1, newbin$, LenInBin%CLOSEfp1"File length is: ";LOF(OutBin$)KEYPRESSEND
Remarks: Note well that the size of binobject1 and binobject2 should be the same! Also, when specifying a pointer it should be prefixed with a '*' dereferencing operator. For example,
BCOPY *pv1 TO v2