This family of functions :-
AdsEvalLogicalExpr
AdsEvalNumericExpr
and AdsEvalStringExpr
is still supported through to ADS12. They only work for XBase expressions (not the SQL scalar functions, although there is an overlap). They handle fieldnames surprisingly quickly. To concatenate fieldnames, you have to use the '+' operator, and you have to ensure all fields are "stringified" before applying the '+' operator. Also, adding a string to a character field will keep the trailing spaces on the end of that field. Here are some example AnsiString arguments for the family of functions above, where FIELD1 is a DBF character field of 10 characters, containing the text 'markj' :-
FIELD1+'Howdy' would give 'markj Howdy'
RTRIM(FIELD1)+' Howdy' would give 'markj Howdy'
If FIELD1 was a date field, you would have to use DTOC(FIELD1) to add it to a string, and if it were a numeric field, you would have to use LTRIM(STR(FIELD1)). N.B. You cannot use a memo field in such constructs - the only way you can use a memo field in an ADS expression is in EMPTY(FIELD1), i.e. with the EMPTY function surrounding it.
So, your first example would work as is, and the single equals sign means return true if the first 3 characters of the field match the test string. Double equals would mean exact match. But your second example needs you to specify how to concatenate the strings, and the expression would have to be :-
RTRIM(FIELD1)+'_'+RTRIM(FIELD2)+'.'+RTRIM(FIELD3)
The reason that the functions are obsolete, is that, when the result of the evaluation exceeds about 4K in length, the expression engine throws exceptions (error 4404 expression engine stack overflow is one of them). HTH.
answered
17 May '16, 04:01
ADS Veteran MJ
276●5●7●17
accept rate:
8%