Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AND / OR boolean help
Message
From
10/04/2002 15:22:53
 
 
To
10/04/2002 15:05:16
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00643405
Message ID:
00643413
Views:
6
Hi all,

I have and/or boolean clause which worked fine only for OR fo any one word to maximum of 4 words but did not work at all for AND if I put one of 4 words
please correct my codes if something is wrong,
Thanks in advance,
Paul


for example :

OR case:

4 words to be entered : in 4 textboxes .

box1,box2,box3,box4

my name is paul OK
my name is OK
my name OK
my OK
---------------------------------------------------------

AND CASE :

4 words to be entered : in 4 textboxes .

box1,box2,box3,box4

my name is paul OK
my name is INCORRECT
my name INCORRECT
my INCORRECT

ALWAYS NEEDED 4 WORDS IN FULL IN ORDER TO HAVE SOMETHING BUT
I WOULD LIKE TO ENTER ONLY ONE WORD LIKE :

my STILL HAVE TO GIVE ALL my ANYWAY.


-------------------------------------------------
cMemos1=iif(empty(allt(cMemos1)),'',allt(cMemos1))
cMemos2=iif(empty(allt(cMemos2)),'',allt(cMemos2))
cMemos3=iif(empty(allt(cMemos3)),'',allt(cMemos3))
cMemos4=iif(empty(allt(cMemos4)),'',allt(cMemos4))

CREATE CURSOR dbtemp1 ( empno C(5),notes m(10) )

lcEmptyMemo = [SELECT * FROM dbtemp2 WHERE empty(cMemos1) OR empty(cMemos2) OR empty(cMemos3) OR empty(cMemos4) INTO cursor dbtemp1 ]

llBoolean1 = IIF(thisform.opgtext1.value = 1, [AND ], [OR ])

lcAndOrMemo = ;
[SELECT empno,notes FROM dbtemp2 ] + ;
[WHERE ] + ;
[cMemos1 $ UPPER(notes) ] + llBoolean1 + ;
[cMemos2 $ UPPER(notes) ] + llBoolean1 + ;
[cMemos3 $ UPPER(notes) ] + llBoolean1 + ;
[cMemos4 $ UPPER(notes) ] + ;
[INTO cursor dbtemp1 ]

if empty(cMemos1) and empty(cMemos2) and empty(cMemos3) and empty(cMemos4)
&lcEmptyMemo
else
&lcAndOrMemo
endif
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform