Android Question How to assign values to array using variable?

vecino

Well-Known Member
Licensed User
Longtime User
Hello, how I can do?

Example:
B4X:
aSente(iX).aParams = Array As String( "1","2","3" )  
Log( aSente(iX).aParams(0) )  ' display  "1"
Example using variable:
B4X:
cT = ""1","2","3""  '  <-   ???
'Dim act() As String = Array As String("1","2","3")
Dim act() As String = Array As String( cT )
aSente(iX).aParams =  act              
Log(aSente(iX).aParams(0))  ' display  "1","2","3"    <--- :confused:
 

vecino

Well-Known Member
Licensed User
Longtime User
Hi, thanks. I think I have not explained well.

B4X:
cT = "1,2,3"
'Dim act() AsString = ArrayAsString( cT )
aSente(iX).aParams = array as string( cT )    '  <--  How do I assign the variable with values?
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Thanks, LucaMs, but the problem is how do using a variable?

B4X:
aSente(x).aParams = array as string( aVariable )
 
Upvote 0
Top