'KOIN' -- as I expected it to be ....
As noted in a different response, this is occuring for a user, not locally, and this is all the code. I do not see how lcFolder could be changing, nor how it could be not found (result from GetKey) ... etc.
Is the matching done for the key case-insensitive? Does it do an exact match, or what?
>What is the value of lcFolder at the time of error?
>
>>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