Array of strings with two dimensions

Discorez

Member
Licensed User
Longtime User
Sorry for the simple question.
I want to create array of strings with two (or more) dimensions.

Code:
Dim Values (3,3) As String
...
Values () = Array As String (("One", "Two", "Three") , ("Cat", "Dog", "Horse"))
But compiler shows error "Missing parameter"

What syntax will be correct?
 
Thanks for reply, Erel
But...
If the array contains two tens of values then I need write forty lines of
Code:
values(x, x) = "..."
I will use two single dimension arrays - it is simpler ))
 
Upvote 0
Thanks for reply, Erel
But...
If the array contains two tens of values then I need write forty lines of
Code:
values(x, x) = "..."
I will use two single dimension arrays - it is simpler ))
Not neccessarily. You can always have your array in a single string (or a list and so on), with items coded with separator character in between. Then you can use regex.split inside a populating loop.
 
Upvote 0
mc73, thanks.
Certainly, I know this way, but in B4PPC I can set multidimension array values, as shown in the first post.
And I thought that in the B4A there is such possibility with similar syntax...
In my situation it's simpler to use two arrays than to parse string values with RegEx.
 
Upvote 0
Back
Top