Hi, another reference to good old VB6, creating a form in VB6 you could create labels or text fields using an array, so the first label would be call say Text1 and if you copied it and pasted the program would ask if you wanted to create an array
so the previous label would be Text1(0) and the copied one named Text1(1) and so on, this was to me, a brilliant aid in that when programming, for next loops were extremely easy to change the values of the created array i.e.
The problem is I can't find a similar way of doing it in B4J so I have manually created the labels, say b1, b2, b3 etc. So if I wish to change the background color of all the labels I have to do them one by one, i.e.
I assume there is a better way of coding this, again in my previous reincarnation using MSM (MUMPS) you could assign a new variable to use in the for next loop i.e.
Sadly I'm at a loss in B4J, can anyone help, thanks in advance
so the previous label would be Text1(0) and the copied one named Text1(1) and so on, this was to me, a brilliant aid in that when programming, for next loops were extremely easy to change the values of the created array i.e.
B4X:
for i = 0 to 10
Text1(i).BackColor = &HFFFFFF
next i
The problem is I can't find a similar way of doing it in B4J so I have manually created the labels, say b1, b2, b3 etc. So if I wish to change the background color of all the labels I have to do them one by one, i.e.
B4X:
Dim x As B4XView = b1
x.Color = 0xFFFFFAFA
Dim x As B4XView = b2
x.Color = 0xFFFFFAFA
Dim x As B4XView = b3
x.Color = 0xFFFFFAFA
Dim x As B4XView = b4
x.Color = 0xFFFFFAFA
Dim x As B4XView = b5
x.Color = 0xFFFFFAFA
Dim x As B4XView = b6
x.Color = 0xFFFFFAFA
Dim x As B4XView = b7
x.Color = 0xFFFFFAFA
Dim x As B4XView = b8
x.Color = 0xFFFFFAFA
Dim x As B4XView = b9
x.Color = 0xFFFFFAFA
Dim x As B4XView = b10
x.Color = 0xFFFFFAFA
I assume there is a better way of coding this, again in my previous reincarnation using MSM (MUMPS) you could assign a new variable to use in the for next loop i.e.
B4X:
Dim var as string
for i = 1 to 10
var = "b" & i
Dim x As B4XView = @var
x.Color = 0xFFFFFAFA
next i
Sadly I'm at a loss in B4J, can anyone help, thanks in advance