Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UDF's in a FOR stmt
Message
De
26/02/2000 11:35:04
David Abraham
David Abraham & Associates, Inc.
New York City, New York, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
UDF's in a FOR stmt
Divers
Thread ID:
00338042
Message ID:
00338042
Vues:
47
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform