Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting field presence in dbf
Message
De
28/07/2007 08:16:45
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
27/07/2007 17:21:06
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01244177
Message ID:
01244342
Vues:
25
>>Hey all
>>
>>Some time ago I think Fabio Lunardon demonstrated using fsize to check for the presence of a field. What thread was that? I can't find it though I looked.
>>
>>Considering the need to manage SET COMPATIBLE for a UDF to use FSIZE I can't see it being the fastest way.
>>
>>I have used a UDF based on TYPE() and it is faster than a UDF using FSIZE that also handles setting and resetting SET COMPATIBLE. I think I found FIELD() is faster.
>>
>>There is another consideration. Using a UDF can be slow, so using an idea that is in my FoxPro Advisor article: http://advisor.com/doc/17440, the command that can detect a field with the fewest external dependencies could be directly injected into code. It seems the easiest and fastest is to use FIELD().
>>
>>Did FIELD() always accept the fieldname and alias?
>
>Probably best one is:
>field(upper(m.Field)) == upper(m.Field)
>
>fsize() is better than Type() thinking reliability. Afields() + ascan() is yet one of the best IMHO.

aFields + ascan is too much work. It cannot be executed as a single expression and must be a UDF or a few lines of code.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform