Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mdot
Message
De
07/01/2005 09:51:07
 
 
À
07/01/2005 00:48:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Mdot
Divers
Thread ID:
00974967
Message ID:
00975080
Vues:
26
>Hi All,
>
>I am trying to confirm a point iro the working of mdot: if I have a file with 10 fields and 100 records and I need to scan through this file and inside my loop I reference 10 variables then will VFP need to lookup and resolve 10 vars x 10 fields x 100 recs = 10,000 field/variable references? Would using mdot avoid the need to perform 10,000 field/vars lookups?

Hi Jos,

Not knowing the internal workings of VFP, this is just speculation on my part, but is a logical extension of how I understand VFP to work.

Because the BY DESIGN behavior is to assume that any non-Mdot-prefixed variable is possibly a field in the current workarea, it looks like an ambiguous reference to the VFP engine that must be resolved at runtime, and that a lookup in the field list must be required any time one is encountered.

Because Mdot syntax exists, my logical assumption is that it must immediately identify the variable as a variable and not a field, so therefore it should short circuit the lookup process and therefore be more efficient. While the performance hit is probably not substantial in most cases, if my assumptions are correct, to me, NOT using Mdot is much like programming a long case structure in which the most often encountered case is placed as the last case or in the otherwise position in the structure forcing EVERY case to be evaluated EVERY time.

I think that the VFP team could provide a definitive answer, but the answer might be considered sacrilege to many here and cause dissent in the community, when the actual performance hit either way is not worth possibly enraging either camp.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform