>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