iOS Question Variable Name

Claude Brun

Active Member
Licensed User
Longtime User
Hello, I have a table with items xx1, xx2, xx3 ...
I have to fill all these items with the same value. Xx01 = "x", xx02 = "x" ...
but I would like to make a loop from 1 to n, build the name of the variable "xx" & i
But I do not know how to use this variable name to load the value

Thank

PS : excuse my poor english
 

Star-Dust

Expert
Licensed User
Longtime User
I would use the map

B4X:
Dim M As Map
 
M.Initialize
 
For I=1 To 10
     M.Put("xxx" & I, "X")
Next

Log(M.Get("xxx1"))
 
Upvote 0
Top