xsharp.eu • New AND , OR etc. Foxpro Keywords
Page 1 of 1

New AND , OR etc. Foxpro Keywords

Posted: Mon Oct 21, 2019 1:44 pm
by Karl-Heinz
Hi Robert

1. I´ve tried the FP Evaluate() func with some expressions, and indeed FP allows e.g. ".and." and "and". :woohoo:

Code: Select all

a = .t.
b = .f.

? evaluate ( "a .and. b" ) && .f.
? evaluate ( "a and b" ) && .f.

?
? evaluate ( "a .or. b" ) && .t.
? evaluate ( "a or b" ) && .t.

doing the same with X#, the macrocompiler currently throws an unexpected 'AND'' error

Code: Select all

? Evaluate( "a and b" )   
? Eval( MCompile("a and b") ) 
2. a Fox sample that creates successfully a CDX.

NOTE: The for condition uses "and" and not ".and."

Code: Select all

set talk off
set safety off
clear

cpfad = "D:test"
cDBf = "small.dbf"
cCdx = "small2.cdx"

use ( cPfad + cDbf )

index on upper (last) for upper (last) = "O" and age >12 tag order1 of ( cPfad + cCdx )

With the little help from the VO STD.UDC i created a "INDEX ON TAG" UDC, but the X# index creation

Code: Select all

INDEX ON Upper(LAST) TAG ORDER1 TO (cPath + cCDX ) FOR Upper (LAST)= "O" AND AGE  > 12 
fails if "and" is used, because the for condition is translated to:

Code: Select all

DbSetOrderCondition( "Upper(LAST)="O"ANDAGE>12" , {||Upper(LAST)="O"ANDAGE>12} ,  ,  ,  ,  , ,  ,  ,  ,  , .F. ,  ,  ,  )
Should i open a ticket, or is this already on the ToDo list ?

regards
Karl-Heinz

New AND , OR etc. Foxpro Keywords

Posted: Mon Oct 21, 2019 2:03 pm
by robert
Karl-Heinz,

Please open a ticket and I will ask Nikos to look at it.

Robert