Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Item Index unk
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00813212
Message ID:
00813546
Views:
7
Glenn

This might be helpful.
For n = 1 to toObj.count
   if compobj(toObj.Item(n), this)
      exit
   endif
next
>Not in this case Sergey, I only have an object reference to the item sort of like this:
>
>Function dosomethihng
>lparameters toObj && as collection item
>nindex = toObj.whatismyindex()
>define bar (whatismyindex) of somemenu prompt toObj.cprompt
>return
>
>
>In other words I only have the Item and not the collection.
>
>>Glenn,
>>
>>You would use FOR EACH and compare object property(s) to the value(s) you know.
>>
>>>Ok, I know now how to get an index if one knows the key to a collection item
>>>nIdx = oCollection.getkey(cKey)
>>>
>>>and I now know how to get a key
>>>cKey = oCollection.getkey(nIdx)
>>>
>>>but how do you get either if you know neither? I have an object reference to an item but I do not know the index or key. Any ideas?
>>>
>>>Thanks
>>>
>>>Glenn
Tracy
Previous
Reply
Map
View

Click here to load this message in the networking platform