Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why Screen.Forms(i) dont work?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00450381
Message ID:
00450394
Views:
37
>Thanks Rick And Larry!!!
>
>From now since i know the problem, i decide to solve it hardcoding 'controls(1)'
>
>FOR i = 1 TO _SCREEN.CONTROLCOUNT
> _SCREEN.REMOVEOBJECT(_SCREEN.CONTROLS(i).NAME)
>ENDFOR

I think you mean
_SCREEN.REMOVEOBJECT(_SCREEN.CONTROLS(1).NAME)

IAC, you could also use the ControlCOunt property in the RemoveObject line. I saw this technique in a message by Ed Rauh last week:
With _Screen
   for i = 1 TO .ControlCount
      .RemoveObject(.Controls(.ControlCount).Name)
   endfor
Endwith
The range for i is pre-initialized but ControlCount continually changes during the process. This will always remove the last object in the collection.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform