Hi All
I have 16 labels [lblF0 to lblF15] the text of these labels is changed by the user.
I wish to build a list [Item0 to Item15] showing the text of the labels, first thought was a For/Next loop [ i = 0 to 15].
EG
Of course this does not work, temp is a string not the name of the label.
Is there a simple way to use/convert the string as/to the name of the label?
I could go down the path of:
If i = 0 then Item(i) = lblF0.text
If i = 1 then ........
but not elegant.
Regards Roger
I have 16 labels [lblF0 to lblF15] the text of these labels is changed by the user.
I wish to build a list [Item0 to Item15] showing the text of the labels, first thought was a For/Next loop [ i = 0 to 15].
EG
B4X:
private temp as string
For i = 0 to 15
temp = "lblF"&i
Item(i) = temp.text
Next
Of course this does not work, temp is a string not the name of the label.
Is there a simple way to use/convert the string as/to the name of the label?
I could go down the path of:
If i = 0 then Item(i) = lblF0.text
If i = 1 then ........
but not elegant.
Regards Roger