@John M // help here
Variable = var + y //????? How do I join a variable and a number to make one new variable
Textfield.text = variable.totext
Y = y + 1
If y>3 then exit
For starters John, a variable can be a number or a string as you may well know.
From what you posted in your original post, you declared var as a string, yet you didn't assign it a value!
I've adjusted the code to a include the assignment of "Var". btw., it's good practice to try to stick with capitalisation. Although, as far as I'm aware Xojo doesn't care if you code "Var1" or "vAR1" - they are treated one and the same, it's not case sensitive. Nevertheless, it makes it easier for you and others to read if you stick to a style
Dim variable as string
Dim var1 as string
Dim var as string
Var1 = "ABCDE"
var = "XYZ"
Dim y as integer
Y = 1
// shown here:
variable = var + Str(y) // This is one way to join (concatenate) a string and a number to make one new (string) variable.
Textfield1.text = variable
This works as expected using a push button and a text field. Adding a loop (to increment the number) from this point is easy enough.
If you explain more, then you'll get better help. This is as far as I can help :)