Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UDF's in a FOR stmt
Message
From
26/02/2000 11:35:04
David Abraham
David Abraham & Associates, Inc.
New York City, New York, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
UDF's in a FOR stmt
Miscellaneous
Thread ID:
00338042
Message ID:
00338042
Views:
45
Try this fun experiment in VFP 6.0 (this problem may apply across all FP's but I am using VFP6.0).

Experiment One
++++++++++++++
from the command window:

USE
BROWSE FOR MOD(VAL(),3) = 0

A no brainer, right? You see every third record in the table.


Experiment Two
++++++++++++++
create a udf(),

FUNCTION filt_exper
xxx = MOD(VAL(),3) = 0
RETURN xxx

then, from the command window:

USE
BROWSE FOR filt_exper()

A no brainer, right? You still see every third record in the table.


Experiment Three
++++++++++++++++
edit the udf() thus,

FUNCTION filt_exper
xxx = MOD(VAL(),3) = 0
WAIT WINDOW STR(RECNO()) + " " + IIF(xxx=.T.,"YES","NO") TIMEOUT 1.0
RETURN xxx

then, from the command window:

USE
BROWSE FOR filt_exper()

Whoa, what is going on here? This is STRANGE behavior.

Now, the real question is: are YOU experiencing this strange behavior too, or is it only my installation of VFP 6.0 that is acting in such a funny way? Please, please let me know your results. And if you DO get my strange behavior, is this a known phenomenon in VFP (problems using a udf() with a FOR statement) and where can I read about it.

Caution: Do NOT try this on a large table. The best size is about two dozen records.

David
Next
Reply
Map
View

Click here to load this message in the networking platform