Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter question
Message
From
31/03/2000 19:05:09
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00353657
Message ID:
00353725
Views:
16
>I'm running into the problem where I set the filter to a variable and later on it moves the record pointer and complains that the variable doesn't exist when it re-evaluates the filter.
>
>Is there a way to say "SET FILTER TO custno = lcCustno" and have it set to the _value_ in lcCustno so that later on it doesn't need to have lcCustno in scope?
>

If custno is a string, and cannot legally contain [ or ] as part of the string, so that they can be used as safe delimiters:

SET FILTER TO custno = [&lcCustno]

If custno is a numeric:

lcCustNo = STR(nCustNoToTest)
SET FILTER TO custno = &lcCustno

In these cases the filter contains a literal created via macroexpansion, and literals do not change because of scope issues. In both cases, the content of lcCustNo must be a string.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform