User Tools

Site Tools


dbaseiii_other.htm
Navigation:  ISAM File Drivers > dBaseIII Database Driver >====== dBaseIII:Other ====== Previous pageReturn to chapter overviewNext page

Boolean Evaluation

dBase III allows a logical field to accept one of nine possible values (y,Y,n,N,t,T,f,F or a space character). The space character is neither true nor false. When using a logical field from a preexisting database in a logical expression, account for all these possibilities. Remember that when a STRING field is used as an expression, it is true if it contains any data and false if it is equal to zero or blank. Therefore, to evaluate a Logical field's truth, the expression should be true if the field contains any of the “true” characters (T,t,Y, or y). For example, if a Logical field were used to specify a product as taxable or nontaxable, the expression to evaluate its truth would be:

(If Condition):

   Taxable='T' OR Taxable='t' OR Taxable='Y' OR Taxable='y'

Large MEMOs

Clarion supports MEMO fields up to a maximum of 64K. If you have an existing file which includes a memo greater than 64K, you can use the file but not modify the large MEMOs.

You can determine when your application encounters a large MEMO by detecting when the memo pointer variable is non-blank, but the memo appears to be blank. Error 47 (Bad Record Declaration) is posted, and any modification to the MEMO field is ignored.

Long Field Names

dBase III supports a maximum of 10 characters in a field name. If you require more, use an External Name with 10 characters or less.

International Sort Sequence

The dBaseIII driver supports international sort orders, however, to maintain compatibility with dBaseIII's international sort order, remove the CLADIGRAPH= line from ..\BIN\Clarion7.ENV file.

KEY Definitions

dBase III supports the use of expressions to define keys. Within the Dictionary Editor, you can place the expression in the external name field in the Key Properties dialog. The general format of the external name is :

'FileName=T[Expression]'

Where FileName represents the name of the index file (which can contain a path and file extension), and T represents the type of the index. Valid types are: C = character, D = date, and N = numeric. If the type is D or N then Expression can name only one field.

String expressions may use the '+' operator to concatenate multiple string arguments. Numeric expressions use the '+' or '-' operators with their conventional meanings. The maximum length of a dBase III expression is 250 characters.

The expression may refer to multiple fields in the record, and contain xBase functions. Square brackets must enclose the expression. The currently supported functions appear below. If the driver encounters an unsupported Xbase function in a preexisting file, it posts error 76 'Invalid Index String' when the file is opened for keys and static indexes.

Supported xBase Key Definition Functions

ALLTRIM(string) Removes leading and trailing spaces.
CTOD(string) Converts a string key to a date. The string must be in the format mm/dd/yy; the result takes the form 'yyyymmdd'. The yyyy element of the date defaults to the twentieth century. An invalid date results in a key containing blanks.
DELETED() Returns TRUE if the record is deleted.
DTOC(date) Converts a date key to string format 'mm/dd/yy.'
DTOS(date) Converts a date key to string format 'yyyymmdd.'
FIXED(float) Converts a float key to a numeric.
FLOAT(numeric) Converts a numeric key to a float.
IIF(bool,val1,val2) Returns val1 if the first parameter is TRUE, otherwise returns val2.
LEFT(string, n) Returns the leftmost n characters of the string key as a string of length n.
LOWER(string) Converts a string key to lower case.
LTRIM(string) Removes spaces from the left of a string.
RECNO() Returns the current record number.
RIGHT(string, n) Returns the rightmost n characters of the string key as a string of length n.
RTRIM(string) Removes spaces from the right of a string.
STR(numeric[,length[,decimal places]]) Converts a numeric to a string. The length of the string and the number of decimal places are optional. The default string length is 10, and the number of decimal places is 0.
SUBSTR(string,offset,n) Returns a substring of the string key starting at offset and of n characters in length.
TRIM(string) Removes spaces from the right of a string (identical to RTRIM).
UPPER(string) Converts a string key to upper case.
VAL(string) Converts a string key to a numeric.
dbaseiii_other.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1