Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove item from VFP collection
Message
From
15/05/2005 06:01:22
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Remove item from VFP collection
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01014330
Message ID:
01014330
Views:
208
Hi,
I have a collection that storing reference of empty objects. I want to remove those item which its cType = 'keyword'.

I tried this code, but it doesn't work correctly. It only remove some matched item but not all.
FOR EACH loItem IN myCollection
  IF loItem.cType = 'keyword'
    myCollection.Remove(loItem.cKey)
  ENDIF
NEXT
Currently, I use array to store all matched item key in FOR EACH loop, then only remove them one by one.

Any other way to do this?

Thank you
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Next
Reply
Map
View

Click here to load this message in the networking platform