Netnoobie Posted May 27, 2003 Posted May 27, 2003 Ok, so I haven't touched these in a long time and I can't quite recall how to populate them. Here's what I have: I have two digits (say 180 and 200) and need to store the data like (1,180) (2,181) (3,183) etc. How can I dynamically declare the array and populate it like that? I can get the numbers in between, but I need to save it all in an array like that and that's where my memory is foggy. Declare like: Dim arNumber(x, y) As Integer ? Populating the correct coordinates is also where I think I forced myself to forget it all. Many thanks. Quote
AndreRyan Posted May 28, 2003 Posted May 28, 2003 Public Structure MyNumbers Public MyNum1 as Integer Public MyNum2 as Integer End Structure Public Class Class1 Dim MyArray() as MyNumbers Public Sub CreateArray() Redim MyArray(3) With MyArray(1) .MyNum1 = 50 .MyNum2 = 100 End With End Sub End Class Or Structure ... Sub ... Dim MyArray as ArrayList, Data as MyNumbers Data.MyNum1 = 50: Data.MyNum2 = 100 MyArray.Add(Data) End Sub ... If you want to use a "Table" Dim MyArr(,) as Integer Redim MyArr(200, 200) MyArr(156, 234) = 10 Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.