Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting field presence in dbf
Message
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:
01244419
Vues:
22
I'm not sure I get your point. I don't know if you're poking fun at the minor, insignificant changes that some people want to apply to example code, or if you're making a serious statement. Ultimately, the small changes you made are inconsequential. IMHO, some of them make the routine less obvious. But, as I said, I can't determine if you're serious or not.

>Russel,
>
>as this thread is on nearly always unnecessary micro-optimization, let me "optimize"<g>
>
>*------------------------------------------------------------------------------
>* Procedure :  IsFieldInTable
>* Purpose   :  This procedure will return the position of a field in a table
>*              if the field exists in the table, otherwise it will return a zero.
>*
>* NOTE      :  This function could be made a little more efficient via the
>*              use of the FIELD function, however this function does double
>*              duty by indicating if the field exists (nonzero return value) and
>*              the position of the field in the table, which some of the calling
>*              routines make use of.
>*
>* Programmer:  Thomas Ganss
>* Commentary:  Russell Campbell
>* Copyright :  BSD License
>* Date      :  10/29/2001
>* Revisions :
>*------------------------------------------------------------------------------
>procedure IsFieldInTable
>lparameters tcFieldName, tcTableName
>	
>	local MyFieldsArray[1], RtnVal
>	
>	if afields(MyFieldsArray, evl(m.tcTableName, alias()) > 0
>		RtnVal = ascan(MyFieldsArray, alltrim(m.tcFieldName), -1, -1, 1, 7)
>		if m.RtnVal > 0
>			RtnVal = asubscript(MyFieldsArray, m.RtnVal, 1)
>		endif
>        else
>	        RtnVal = -1
>	endif
>	
>return m.RtnVal
>
>regards
>
>thomas
eCost.com continues to rip people off
Check their rating at ResellerRatings.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform