Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
And / Or operator Help
Message
De
21/03/2002 15:41:44
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
 
À
21/03/2002 15:31:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00635713
Message ID:
00635715
Vues:
12
Paul,

You can do this with macro expansion.
llBoolean1 = IIF(TextMemo1 = 1, [AND ], [OR ]) && Watch spaces
llBoolean2 = IIF(TextMemo2 = 1, [AND ], [OR ]) 
llBoolean3 = IIF(TextMemo3 = 1, [AND ], [OR ]) 

lcCommand = ;
    [SELECT * FROM dbtemp2 ] + ;
    [WHERE ] + ;
    [cMemos1 $ UPPER(notes) ] + llBoolean1 + ;
    [cMemos2 $ UPPER(notes) ] + llBoolean2 + ;
    [cMemos3 $ UPPER(notes) ] + llBoolean3 + ;
    [cMemos4 $ UPPER(notes) ] + ;
    [INTO cursor dbtemp1 ]

&lcCommand
>Hi all,
>
>cMemos1=allt(cMemos1)
>cMemos2=allt(cMemos2)
>cMemos3=allt(cMemos3)
>cMemos4=allt(cMemos4)
>
>ThisForm.TextMemo1.value
>ThisForm.opgtext1.value=1,'and','or')
>
>
>CREATE CURSOR dbtemp1 ( empno C(5), dfilled D,subject C(30), author C(20), l_update D, notes m(10) )
>
>SELECT * FROM dbtemp2  WHERE cMemos1 $ UPPER(notes) OR cMemos2 $ UPPER(notes) OR cMemos3 $ UPPER(notes) OR cMemos4 $ UPPER(notes)INTO cursor dbtemp1
>
>this above select worked fine but I would like to apply And / or radiobuttons
>in between each memo search.
>
>in my form , I have 4 text boxes to ask word1 in textmemo1 and so on :
>
>textmemo1 And Or radiobutton to select
>textmemo2 And Or radiobutton to select
>textmemo3 And Or radiobutton to select
>textmemo4 And Or radiobutton to select
>
>and I try to use :
>
>
ThisForm.TextMemo1.value
>ThisForm.opgtext1.value=1,'and','or')
>
>in my codes to complete but not successfully,
>
>any help in coding.
>
>Thanks in advance,
>Paul
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform