![]() |
|
|
#1 (permalink) |
|
Junkie
Location: RI
|
[VB] Linked List question
I doubt that's the correct wording for it. I'm used to C, not VB. Anyway, I'm trying to make multiple instances of a something so that I can easily edit them, then I want to write it to a file. My problem right now is, I don't know how to make a list like that or if it's possible. Thanks.
|
|
|
|
|
#3 (permalink) | |
|
Crazy
Location: Belgium
|
Quote:
something like this: Code:
Public Class Form1
Inherits System.Windows.Forms.Form
Dim YourArray() As YourClass
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'...
'your code here
'...
PutInArray(YourInstance)
'...
WriteToFile(YourArray)
End Sub
Sub PutInArray(ByVal sYourInstance As YourClass)
ReDim Preserve MyArray(YourArray.Length + 1)
YourArray(YourArray.Length) = sYourInstance
End Sub
Sub WriteToFile(ByRef sYourArray As YourClass)
Dim i As Integer
'your file open code here
For i = 0 To UBound(sYourArray)
'...
'your file write code here
'...
Next
'your file close code here
End Sub
End Class
|
|
|
|
| Tags |
| linked, list, question |
|
|