CONVERT
Topic group Related topics Example
Adds a _dbaselock field to a table for storing multiuser lock information.
Syntax
CONVERT [TO <expN>]
TO <expN>
Specifies the length of the multiuser information field to add to the current table. The <expN> argument can be a number from 8 to 24, inclusive. The default is 16.
Description
Use CONVERT to add a special _dbaselock field to the structure of the current table. In general, CONVERT is a one-time operation required for each table that is shared in a multi-user environment.
Use the option TO <expN> to specify the length of the field. If you issue CONVERT without the TO <expN> option, the width of the field is 16. If you want to change the length of the _dbaselock field after using CONVERT, you can issue CONVERT again on the same table. To view the contents of the _dbaselock field, use LKSYS( ).
Note
You must use the table exclusively (USE...EXCLUSIVE) before issuing CONVERT. Any records marked as deleted with be lost during the CONVERT.
The _dbaselock field contains the following values:
Count |
A 2-byte hexadecimal number used by CHANGE( ) |
Time |
A 3-byte hexadecimal number that records the time a lock was placed |
Date |
A 3-byte hexadecimal number that records the date a lock was placed |
Name |
A 0- to 16-character representation of the login name of the user who placed a lock, if a lock is active |
The count, time, and date portions of the _dbaselock field always make up its first 8 characters. If you accept the default 16-character width of the _dbaselock field, the login name is truncated to 8 characters. If you set the field width to fewer than 16 characters, the login name is truncated the necessary amount. If you set the width of <expN> to 8 characters, the login name doesn't appear at all.
Every time a record is updated, dBASE Plus rewrites the count portion of _dbaselock. If you issue CHANGE( ), dBASE Plus reads the count portion from disk and compares it to the previous value it stored in memory when the record was initially read. If the values are different, another user has changed the record, and CHANGE( ) returns true. For more information, see CHANGE( ).
LKSYS( ) returns the login name, date, and time portions of the _dbaselock field. If you place a file lock on the table containing the _dbaselock field, the value in the _dbaselock field of the first record contains the information used by CHANGE( ) and LKSYS( ). For more information, see LKSYS( ).
Note
CONVERT doesn't affect SQL databases or Paradox tables.