>I have some textboxes on a form.
>
>To fill them I do as follows:
>THISFORM.txtBox1.Value = && some variable or value goes here
>THISFORM.txtBox2.Value = && some variable or value goes here
>THISFORM.txtBox3.Value = && some variable or value goes here
>THISFORM.txtBox4.Value = && some variable or value goes here
>
>Can I do a set of commands like this instead? And what would the syntax be? The following example does not have valid syntax, but I think you see what I am trying to do:
>FOR i = 1 to 4
> THISFORM.txtBox(i).Value =
>ENDFOR
If you use this naming convention, then you can do the following:
FOR i=1 to 4
STORE <i>something to store</i> TO ('thisform.txtBox'+ALLTRIM(STR(i))+'.Value')
ENDFOR
Obviously, the names of the controls have to be formable in this fashion. The STORE...TO... syntax is needed to permit the use of name substitution for the target name, otherwise, you need to macro-expand the name, something like:
cThisName = 'thisform.txtbox' + ALLTRIM(STR(i))+'.Value'
&cThisName =
whatever>
>Thanks for the help.
>
>All the best,
>Steve Kramer