Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remove a Page in A Pageframe
Message
De
02/09/2003 04:34:54
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00825178
Message ID:
00825195
Vues:
12
Hi Bernhart,

FOR EACH is not good method for scan and remove objects on one collection.

Internal it uses index or pointer, when you remove a element, collection index and pointer shift left, and you cannot remove two consecutive objects.

Use this:
WITH THIS.Pageframe
	PRIVATE  iPage
	FOR iPage=.PageCount TO 1 STEP -1
		.REMOVEOBJECT(.Pages[m.iPage].CAPTION) 
               * I suppose that :
               * .Pages[m.iPage].CAPTION=.Pages[m.iPage].Name
               *    else this code not work well
               * Best is to add a property to the pages 
               *    to remove in order to mark them
	NEXT
ENDWITH
Fabio
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform