What I would like to do is use a loop to change the value of many instances of the same controls.
The control is a combo box class used many times on the same form. I would like to take the following:
oForm = ThisForm.Pageframe1.Page2
oForm.cboAbcspecs1.Enabled = .T.
oForm.cboAbcspecs2.Enabled = .T.
oForm.cboAbcspecs3.Enabled = .T.
oForm.cboAbcspecs4.Enabled = .T.
oForm.cboAbcspecs5.Enabled = .T.
to something along the lines of:
for i=1 TO 5
("oForm.cboAbcSpecs"+ALLTRIM(STR(i))+".Enabled") = .t.
endfor
I have tried a couple of variations of the loop like storing to a variable and macro substitution but I'm still missing somehting. This would eliminate a large amount of repetitive code and would be greatly appreciated.
The control is a combo box class used many times on the same form. I would like to take the following:
oForm = ThisForm.Pageframe1.Page2
oForm.cboAbcspecs1.Enabled = .T.
oForm.cboAbcspecs2.Enabled = .T.
oForm.cboAbcspecs3.Enabled = .T.
oForm.cboAbcspecs4.Enabled = .T.
oForm.cboAbcspecs5.Enabled = .T.
to something along the lines of:
for i=1 TO 5
("oForm.cboAbcSpecs"+ALLTRIM(STR(i))+".Enabled") = .t.
endfor
I have tried a couple of variations of the loop like storing to a variable and macro substitution but I'm still missing somehting. This would eliminate a large amount of repetitive code and would be greatly appreciated.