Copies the contents of the specified binary field to a file.

Syntax

COPY BINARY <field name> TO <filename>
[ADDITIVE]

<field name>

The binary field to copy.

TO <filename>

The name of the file where the contents of the binary field are copied. For predefined binary file types, dBASE Plus assigns the appropriate extension, for example, .BMP, .WAV, and so on. For user-defined binary type fields, dBASE Plus assigns a .TXT extension by default.

ADDITIVE

Appends the contents of the binary field to the end of an existing file. Without the ADDITIVE option, dBASE Plus overwrites the previous contents of the file.

Description

Use COPY BINARY to export data from a binary field in the current record to a file. You can use binary fields to store text, images, sound, video, and other user-defined binary data.

If you specify the ADDITIVE option, dBASE Plus appends the contents of the binary field to the end of the named file, which lets you combine the contents of binary fields from more than one record. When you don't use ADDITIVE, dBASE Plus displays a warning message before overwriting an existing file if SET SAFETY is ON. Note that you can't combine the data from more than one field for many of the predefined binary data types. For example, you can store only a single image in a binary field or file, so do not use the ADDITIVE option of COPY BINARY when copying an image to a file.

OODML

Use the Field object’s copyToFile( ) method.