Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interactivechange
Message
De
14/08/2008 05:48:27
 
 
À
14/08/2008 05:10:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01338786
Message ID:
01338806
Vues:
15
Hi Mohammed,

I'll try to give you a small example. However, this is not so easy, as I usually use my own classlib for stuff like that and it works a bit different than your approach. My class holds a reference to a gridobject who's cursor shall be filtered. The class itself contains a 'growing' grid which contains five columns (searched field, operator, searched value, 'delete row' button and 'add new row' button. Usually the number of allowed rows is five which means, you can create five filters which can refer so any field in the referenced grid.

In your case I would recommend, to use a single method (called from within all four interactivechage events or by bindevent) and in this method there should be something like this (Not tested, just coded on the fly):


LOCAL lcFilter as String, lcOperator as String
lcFilter = ""
lcOperator = " = "

* Repeat this code for each textbox
IF NOT EMPTY(Thisform.Text1.Value)
lcFilter = lcFilter + IIF(EMPTY(lcFilter),"("," and (")
lcFilter = lcFilter ;
+ "LEFT(name1," + ALLTRIM(STR(LEN(ALLTRIM(Thisform.Text1.Value)))) + ") " ;
+ ALLTRIM(lcOperator) ;
+ ' "' + ALLTRIM(Thisform.Text1.Value) + '"'
ENDIF
* End of REPEAT-Block

* use makrosubstitution with lcFilter
SET FILTER TO &lcFilter


>thank you for reply
>How about simply 'use' the 'x2' table(?) and then just work with 'set filter to...' which reacts on the users input in interactivechange? You could create filters like 'set filter to (left(name1,2) == "An")' where "An" is the current Value of your textbox. And with each new character generate a new filter.
>
>i have text1, text2,text3 and text4 as names
>
>i need to make filter for name1 and name2 and name 3 and name4 at text1,text2,text3 and text4,at interactive change or any events
>
>
>
>any small example
>
<snip>
Best Regards
-Tom

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.

Oh, and BTW: 010101100100011001010000011110000101001001101111011000110110101101110011
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform