Replaces the contents of a binary field with the contents of a binary file.

Syntax

REPLACE BINARY <binary field name> FROM <filename>
[TYPE <binary type user number>]

<binary field name>

The binary field of the current table that is replaced by the contents of <filename>.

FROM <filename>

Specifies the file to copy to the binary field in the current record. If you specify a file without including its extension, dBASE Plus assumes a .BMP extension; however, the file may be any type.

TYPE <binary type user number>

Specifies a number that can be used to identify the type of binary data being stored. By default, dBASE Plus attempts to detect the type of file and assigns the appropriate binary type. Use the BINTYPE( ) function to retrieve the type number. The range is from 1 to 32K – 1 for user-defined file types and 32K to 64K – 1 for predefined types (although any number may be specified within the allowable range).

Predefined binary type numbers

Description

1 to 32K – 1 (32,767)

User-defined file types

32K (32,768)

.WAV files

32K + 1 (32,769)

Image files

Description

Use REPLACE BINARY to copy a binary file to the current record's binary field. You can copy one binary file to each binary field of each record in a table.

While memo fields may contain types of information other than text, binary fields are recommended for storing images, sound, or any other binary or BLOB type data.

See class Image for a list of image types that dBASE Plus can automatically detect and display.

OODML

Use the Field object’s replaceFromFile( ) method. The binary type option is not supported.