Clipper:Driver Strings

Top  Previous  Next

There are switches or "driver strings" you can set to control the way your application creates, reads, and writes files with a specific driver. Driver strings are simply messages or parameters that are sent to the file driver at run-time to control its behavior. See Common Driver Features--Driver Strings for an overview of these runtime Database Driver switches and parameters.

Some driver strings have no effect after the file is open, so no SEND function syntax is listed for those strings. However, the SEND function syntax to return the value of the switch is listed for all driver strings.

The Clipper Driver supports the following Driver Strings:

BUFFERS

 

DRIVER('CLIPPER', '/BUFFERS = n' )

[ Status" = ] SEND(file, 'BUFFERS [ = n ]' )

Sets the size of the buffer used to read and write to the file, where the buffer size is (n * 512 bytes). Use the /BUFFERS driver string to increase the buffer size if access is slow. Maximum buffer size is 4,294,967,264. SEND returns the size of the buffer in bytes.

 

The default is three buffers of 1024 bytes each. Increasing the number of buffers will not increase performance when a file is shared by multiple users.

RECOVER

 

DRIVER('CLIPPER', '/RECOVER' )

[ Status" = ] SEND(file, 'RECOVER' )

Equivalent to the Xbase RECALL command, which recovers records marked for deletion. When using the Clipper driver, the DELETE statement flags a record as "inactive." The driver does not remove the record until the PACK command is executed.

RECOVER is evaluated each time you open the file if you add the driver string to the data dictionary. When the driver recovers the records previously marked for deletion, you must manually rebuild keys and indexes with the BUILD statement.

IGNORESTATUS

 

DRIVER('CLIPPER', '/IGNORESTATUS = on | off ' )

[ Status" = ] SEND(file, 'IGNORESTATUS [ on | off ]' )

When set on, the driver does not skip deleted records when accessing the file with GET, NEXT, and PREVIOUS in file order. It also enables a PUT on a deleted or held record. IGNORESTATUS requires opening the file in exclusive mode. SEND returns the IGNORESTATUS setting (ON or OFF) in the form of a STRING(3).

DELETED

 

[ Status" = ] SEND(file, 'DELETED' )

For use only with the SEND command, when IGNORESTATUS is on. Returns the status of the current record. If deleted, the return string is "ON" and if not, "OFF."

ZEROY2K

DRIVER('CLIPPER', '/ZEROY2K = on | off' )

[ Status" = ] SEND(file, 'ZEROY2K [ on | off ]' )

In the header of Clipper files there is a field that stores the year that the file was last edited. Some applications store this as the number of years since 1900. Others store it as a 2-digit year. So for dates in the year 2000 some applications store 0 in this field and others 100. Clarion will read files with either. However it will write 100. Writing 100 may make the files unreadable by products that only support 0. To change this behavior you can with use a driver string of ZEROY2K, a SEND command or a setting in the WIN.INI file.

 

The driver will store 0 in the DBF file header when the WINI.INI setting is set to 1 or 'on' in a SEND command or driver string, otherwise a 100 will be stored in the DBF file header.

The SEND command causes the setting to be set for all files that use that driver, not just for that file.

Example:

WIN.INI

;Sets all Clipper files to store a 0 in the DBF file header

[CWCLIPPER]

ZEROY2K=1

SEND command

SEND('Orders', ZEROY2K='on'  !sets Orders file to store 0 in the DBF file header

SEND('Orders', ZEROY2K='off'  !sets Orders file to store 100 in the DBF file header

Driver String

Orders FILE, DRIVER('clipper', '/ZEROY2K=on'),PRE(ORD)  !SETS Orders file to store 0