vecino Well-Known Member Licensed User Longtime User Nov 26, 2014 #1 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:
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 Nov 26, 2014 #2 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
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?
LucaMs Expert Licensed User Longtime User Nov 26, 2014 #3 vecino said: 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? Click to expand... ...and even now, I'm afraid What it the type of aSente? Your own class? Upvote 0
vecino said: 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? Click to expand... ...and even now, I'm afraid What it the type of aSente? Your own class?
vecino Well-Known Member Licensed User Longtime User Nov 26, 2014 #4 LucaMs said: What it the type of aSente? Your own class? Click to expand... B4X: Type sente ( iNum As Int, cSql As String, aParams() As String ) Dim aSente( 256 ) As sente Upvote 0
LucaMs said: What it the type of aSente? Your own class? Click to expand... B4X: Type sente ( iNum As Int, cSql As String, aParams() As String ) Dim aSente( 256 ) As sente
LucaMs Expert Licensed User Longtime User Nov 26, 2014 #5 aSente(x).aParams = array as string("1","2","3") Upvote 0
vecino Well-Known Member Licensed User Longtime User Nov 26, 2014 #6 Thanks, LucaMs, but the problem is how do using a variable? B4X: aSente(x).aParams = array as string( aVariable ) Upvote 0
Thanks, LucaMs, but the problem is how do using a variable? B4X: aSente(x).aParams = array as string( aVariable )
LucaMs Expert Licensed User Longtime User Nov 26, 2014 #7 aVariable = "1,2,3" aSente(x).aParams = Regex.Split(",", aVariable) Upvote 0
vecino Well-Known Member Licensed User Longtime User Nov 26, 2014 #8 Thank you very much, this solution is perfect I did not know "regex" Upvote 0