Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Issue: Collection.Clear(), I don't find it.
Message
From
13/05/2005 07:18:44
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01013756
Message ID:
01013775
Views:
18
>>>>Why?
>>>
>>>
>>>Collection.Remove(-1)
>>
>>Thanks.
>>Sure that those of the VFPT are amused to complicate the things, mistaking!
>>
>>It had to define Remove(0)=Clear.
>>
>>An other issue is:
>>Remove(-1) clear the Items in descendent order;
>>some trace in the documentation?
>
>There is no simple ways with MS :o))) (Check their site and try to find something)
>How Remove(-1) clear the collection Class is not described anywhere.
>There is no trace for Remove(0) also, I don't know where you find it, but I am sure it works if you say so.

Not, i expected Remove(0) as good choice, not Remove(-1)
( why? Because -1 is the index 1 with a sign error, 0 is another number )

Now, Remove(0) fire a error.

With Remove(-1), or when the collection is destroyed,
VFP remove the Items with this loop
FOR ix=collection.Count to 1 step -1
  collection.Remove(m.ix)
next
Try to use this with 100000 items
FOR ix=1 to collection.Count
  collection.Remove(1)
next
BUT run it only before going to bed :)

Hi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform