Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting fields on a form programmatically
Message
From
22/08/2008 05:22:17
 
 
To
22/08/2008 05:08:26
Jon Neale
Bond International Software
Wootton Bassett, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01340763
Message ID:
01341050
Views:
10
>Ok, something I wil remember for the future, any particular reason for that?
>
>
Oh, yes.
Each RemoveObject decrements the ControlCount. So you'll end up referencing controls that are no longer there.
It also 'shifts' the objects down. So if there are 4 objects and you remove number 2, then number 3 will become number 2, and number 4 will become number 3

So looping backwards is the only way - unless of course you have two loops where #1 builds a list of objectnames to remove and #2 removes them
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform