Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21355

[RESOLVED] Assigning values to a 2d Array

$
0
0
I have a 2d array which will contain the X and Y positions of 32 objects.

How do I get the values in the array (all values are different) so I can later refer to the array like this:

object(n).X = array(n,0)
object(n).Y = array(n,1)

I tried below but get error Can't assign to array

Code:

  '
Private Positions(1 To 32, 1 To 32) As Variant
  '
  '
Private Sub InitArray()
 Positions = Array(22, 177, 20, 196, 0, 217, .................)
End Sub


Viewing all articles
Browse latest Browse all 21355

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>