New AND , OR etc. Foxpro Keywords

This forum is meant for questions and discussions about the X# language and tools
Post Reply
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am

New AND , OR etc. Foxpro Keywords

Post 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
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

New AND , OR etc. Foxpro Keywords

Post by robert »

Karl-Heinz,

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

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply