TextField indexing a loop

I have 21 textfields labeled txtOut1…textOut21. I want to paste data into the text field of one inside of a loop. Here is what ride but no luck. I read the language ref as best I could but not find what I needed. I thought it would be an index…

I know the code is sloppy, just poking at things at the moment.

Dim d As Double
Dim i As Double
Dim x as Integer

d = 0
x = 1

d = (d + (pjWidth - i))
txtOut(x).text = str(d)
x = (x +1)
Loop until x = canvisWP


You could make the textfields into a Control Set. They are described in the User Guide, Book 2: User Interface.

So basically (as Tim indicate)… the “code” would work, but only if you convert txtOut1-txtOut21 to a control set (which by the way will start at 0 not 1)