Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error using collections
Message
De
20/04/2010 18:17:22
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Error using collections
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01461217
Message ID:
01461217
Vues:
141
I have a simple collection named oCalcFolders, which is referenced in the code below.

This is the only place that the collection is touched.

How can I get error 2062," The specified Key already exists" on the next to last line? Doesn't the earlier call to 'GetKey' return a result that indicates whether the key already exists?
lcFolder = Trim (loTableInfo.Folder)
lnIndex = This.oCalcFolders.GetKey (lcFolder)
If lnIndex # 0
	lcCalcFolder = This.oCalcFolders (lnIndex)
Else
	lcCalcFolder = GetOtherCalcDirectory (Left (lcFolder, At ('\', lcFolder) - 1))
	This.oCalcFolders.Add (lcCalcFolder, lcFolder)
Endif
Jim Nelson
Newbury Park, CA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform