Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
For command
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01414931
Message ID:
01414934
Views:
52
>I have several forms with many objects as below
>
> form1.object1.enabled = .F.
> form1.object2.enabled = .F.
> form1.object3.enabled = .F.
>... etc
>
>I need to enabled these properties using for command
>
>for myObj = 1 to 100 do
>
> "form1.object" +myObj + ".enabled = .T.
>
>endfor
>
>Sometimes a form can have 5 objects, others can have 20, 55 , etc
>
>How can I do to prevent errors with for command when and object does not exist ?

for each loObject in Form.Objects
loObject.Enabled = .t.
next

of just check the type of ('thisform.object' + transform(myObj) + '.enabled') = 'L' before trying to set it.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform