Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you save a filter condition?
Message
De
06/09/1998 16:30:05
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00133456
Message ID:
00133698
Vues:
15
Macro substitution has limited length and eval() is not rusmore
optimizable. So the only way is

proc SETFILTER
lpara prmFILTER

priv i, m
for m.i=1 to 8 && 8 == 2048/250 -1
m='M'+ltri(str(m.i))
priv &M
&M = subs( m.prmFILTER, (m.i-1)*250+1, 250 )
endfor

set filter to &m1&m2&m3&m4&m5&m6&m7&m7&m8

>>It's better to use
>>set filter to (cfilter)
>>
>>Use the evaluate expression (i.e. parens) wherever possible. It is many times fster than macro substitution (&)
>>//:^)
>
>Larry,
>
>You are right that name expressions are better than macros, but only where they work. A name expression will not work in the expression of a set filter. They only work where VFP is expecting the name of something. SET FILTER must be either;
>
>SET FILTER &cFilter
>
>or
>
>SET FILTER EVALUATE(cFilter)
Andrus
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform