Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot use myfunc() in SET FILTER TO?
Message
 
To
16/10/1998 20:25:28
Man Wai Chang
Hang Hing Metal Manufacturer
Hung Hom, Hong Kong
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00147370
Message ID:
00147773
Views:
33
>>>When I execute this program,
>>>
>>>use data\payslphd
>>>set filter to myfunc()
>>>I got an error "Invalid Subcript Reference".
>>FPW "thinks" that you're referring to an array.
>
>Not if I used built-in functions, like empty().

True, but FPW "knows" about EMPTY(), it doesn't, apparently, properly resolve a UDF reference.

>>You'll get the same message even passing fields to the function.
>>VFP (6.0 at least) allows you to use a function in a SET FILTER TO.
>
>I tried the same program on VFP 3.0. It worked!
>Just then I don't want to believe in it: user-defined
>functions are not allowed in older version of FoxPro.
>
>Just doesn't make sense... giving a bit of trouble.

In FPW, you can build a filtered index that contains a UDF. If the nature of the filter condition requires that a UDF be used, this is one alternative. Another might be using a query to retrieve the record set. Of course, under VFP, I would hestitate to use either.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform