Counter for variables

BlitzPlus Forums/BlitzPlus Programming/Counter for variables

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi,
I want to have a loop which works like this:
counter=1
total=10
While(counter<total)
label$+counter=CreateLabel("Text"+counter,10*counter,10,40,20,window)
button$+counter=CreateButton("Text"+counter,10*counter,69,20,20,window)
counter=counter+1
Wend

That code works in my head, but not in B+. So can someone explain to me how I would need to change that code so that it would create label1, label2, label3 etc. until it got up to 10.
Thank for any help!
Matt