Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does SET FILTER TO not accept variables?
Message
De
30/11/1998 09:58:24
 
 
À
30/11/1998 09:50:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00162388
Message ID:
00162393
Vues:
24
>Hello,
>
>I am using Visual FoxPro 6.0. I have created a class with a listbox on it which uses a table. I want to set a filter on it which is given by another method outside the class using a parameter. Now I am using the next code:
>
>LPARAMETER mFilter && mFilter = 'value'
>
>USE table IN 0
>SELECT table
>SET FILTER TO table.field = '&mFilter'
>
>This is working.
>
>But now I don't want to define the table.field in the class. I have tried the next code, but that does not work.
>
>LPARAMETER mtable, mFilter && mFilter = "table.field = 'value'"
>
>USE mtable IN 0
>SELECT mtable
>SET FILTER TO mFilter
>
>This code is not working because FoxPro can not find variable mFilter.
>When I use a WAIT WINDOW to display the value of mFilter the value is right.
>
>Can anyone help me with this problem? Thank you in advance.

I think you need to try something like the following.
In the main program:

mtable = "MyTable"
mFilter = "MyTable.MyField = 3" && Set up your filter condition here"

DO MyFilterProc with mtable, mFilter

PROCEDURE MyFilterProc

USE (mtable) IN 0
SELECT (mtable)
SET FILTER TO &mFilter
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform