Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FOR EACH bug
Message
 
 
À
06/03/2003 01:40:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00762002
Message ID:
00762102
Vues:
11
It's not a bug it's just a way collection works. You can use FOR loop to release items of colection.
for i=oFrms.Count TO 1 STEP -1
	oFrms(i).Release
next
* or 
oFrms.Remove(-1)
However, I wouldn't recomend to use second one if you store objects in collection.

>Hi,
>
>I enjoy new collection class very much, but there is a bug I think. If objects are removed inside FOR EACH some of them are omitted.
>
>
>oFrms = createobject('collection')
>oFrms.Add(createobject('form'),'Form1')
>oFrms.Add(createobject('form'),'Form2')
>oFrms.Add(createobject('form'),'Form3')
>oFrms.Add(createobject('form'),'Form4')
>
>*** let's make forms visible
>local oFrm
>for each oFrm in oFrms
>	oFrm.Show
>next
>
>*** ok, now let's try close them
>for each oFrm in oFrms
>	oFrm.Release
>next
>
>*** two forms remains open :(
>messagebox(oFrms.Count)
>
>
>It behaves the same way with _SCREEN.Forms collection. I think it should be considered as bug and be corrected.
>
>Best,
>
>Janusz Czudek
>WORD Software
>www.wordsoft.com.pl
>jczudek@wordsoft.com.pl
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform