Using Xbase commands and functions in Delphi code

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Installing and Using Apollo VCL >

Using Xbase commands and functions in Delphi code

Xbase commands and functions, such as INDEX ON, PACK, UPPER(), DTOS(), and so forth, are not supported by Delphi's compiler and are can only be used from within the TApolloTable object's Index, IndexTag, Query, QueryTest, and Eval* methods (such as EvalString).

 

For example, in Xbase, the following syntax examples are valid:

 

INDEX ON DTOS(HIREDATE) TO HIRED UNIQUE DESCENDING FOR !DELETED() 

sVal := UPPER( LASTNAME + FIRST ) 

 

Unfortunately, adding TApolloTable into your project cannot make Delphi's Pascal compiler understand Xbase commands, functions, and basic syntax. While TApolloTable allows you to continue using an Xbase-like syntax, these still must conform to the syntactical requirements of Delphi's compiler. Therefore, using TApolloTable, the two lines above could be handled like this:

 

ApTbl.Index('HIRED','DTOS(HIREDATE)',IDX_UNIQUE,True,'!DELETED()'); 

sVal := ApTbl.EvalString('UPPER(LASTNAME+FIRST)'); 

 

See Also: xBase Functions Supported