Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Filter
Miscellaneous
Thread ID:
00095992
Message ID:
00096066
Views:
18
>Either way that i run the procedure it still says that the variable is not found. But if I run it in the command window it will work fine. Any ideas?
>
>Thanks

procedure filter_set

lparameters t_f,tblname,condition
select (tblname)
tblFilter = iif(t_f,'set filter to &tblname..stu_ads_id = condition','set filter to')
&tblFilter
return

Because this is done in a procedure the 'condition' parameter loses scope when you exit the procedure. The 'condition' parameter is a local variable and is released when you exit the proc. Therefore, you get "Variable 'condition' not found" error. You might try:

tblFilter = iif(t_f,'&tblname..stu_ads_id = ' + condition,'')
set filter to &tblFilter

In other words the filter string has to have the value of the parameter and not the name of the variable in it.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform