Please tell me ..
how can i Initialise 2 dimentional integer array in visual basic 6.0 .....

if i am giving like this .. it returns error .. at (,)

Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}

please guide me ...

i want initialization as globel array ..

According to Mastering Visual Basic 6 you have to explicitly declare the array dimensions and arrays can not be initialized like that. You have to set each element one at a time.

According to Mastering Visual Basic 6 you have to explicitly declare the array dimensions and arrays can not be initialized like that. You have to set each element one at a time.

tanQ............

is there .. any way ..

i have a sting like this 0100001000111011010101101

so .
how can i assing this string of each digit to a(0 to 4, 0 to 4)
i.e.,,, first 0 for a(0,0)
and next 1 for a(0,1) .. like this ..

please ..

here is a sample. check this out.

''declaring the array here
Dim a(1, 2) As Integer

''printing values
Private Sub Command1_Click()
Dim i As Integer, j As Integer

For i = 0 To 1 Step 1
For j = 0 To 2 Step 1
Print a(i, j)
Next j
Next i
End Sub

''initializing with default values to all possible subscripts
Private Sub Form_Load()
a(0, 0) = 9 & "," & 19
a(0, 1) = 10 & "," & 20
a(0, 2) = 11 & "," & 21
a(1, 0) = 12 & "," & 22
a(1, 1) = 13 & "," & 23
a(1, 2) = 14 & "," & 24
End Sub

hope this will help you.

regards
Shouvik

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.