create an aray on the fly
im building a directX program that will load a map in memory, i want to be able to store if in a 3D array ( eg: map(x,y,z) ) but i dont know the size of the array untill i read the map file
here's the possible dimmensions
10 <= X <= 255
10 <= Y <= 255
1 <= Z <= 3
Re: create an aray on the fly
Quote:
Originally posted by Rudy
im building a directX program that will load a map in memory, i want to be able to store if in a 3D array ( eg: map(x,y,z) ) but i dont know the size of the array untill i read the map file
here's the possible dimmensions
10 <= X <= 255
10 <= Y <= 255
1 <= Z <= 3
VB Code:
Option Explicit
Private Sub Form_Load()
Dim l_strArray() As String
ReDim l_strArray(0)
l_strArray(UBound(l_strArray)) = "First Element"
ReDim Preserve l_strArray(UBound(l_strArray) + 1)
l_strArray(UBound(l_strArray)) = "Second Element"
ReDim Preserve l_strArray(UBound(l_strArray) + 1)
l_strArray(UBound(l_strArray)) = "Nth Element"
Dim i As Integer
For i = LBound(l_strArray) To UBound(l_strArray)
MsgBox l_strArray(i)
Next
End Sub
This should give you enough idea !!!