Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove a Page in A Pageframe
Message
From
02/09/2003 04:34:54
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00825178
Message ID:
00825195
Views:
13
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
Previous
Reply
Map
View

Click here to load this message in the networking platform