I want to create a massive size two dimensional array such as a large 2D tile map, but ran into a limitation I think VB6 has. See my computer has over 8 gigs of memory. I know of computers out there that have even more memory such as custom built gaming pcs. But seriously, you mean to tell me that VB6 can't create a simple 10000 x 10000 array?
Hit play and youll see you'll get Out of Memory error. Not sure if there is a way around that, such as API's like CopyMemory, VarPtrArray, etc. Or even the SafeArray technique. I'll see if it works with them. But why is it severely limited? What is the limitation? I saw on another site that its limited to the range of a Long data type 2,147,483,647, but its wrong because 10000x10000 is 100,000,000, which is no where near the range of the Long data type.
vb Code:
Option Explicit Dim A() As Long Dim W As Long Dim H As Long Private Sub Form_Load() W = 10000 H = 10000 ReDim A(W - 1, H - 1) As Long End Sub
Hit play and youll see you'll get Out of Memory error. Not sure if there is a way around that, such as API's like CopyMemory, VarPtrArray, etc. Or even the SafeArray technique. I'll see if it works with them. But why is it severely limited? What is the limitation? I saw on another site that its limited to the range of a Long data type 2,147,483,647, but its wrong because 10000x10000 is 100,000,000, which is no where near the range of the Long data type.