I'm writing a small program which has the 1-dimensional upperboundless array waitlist() declared class-level. It needs to be able to store an arbitrary amount of members (string datatype), from 0 to however many the user enters. I need to write a sub procedure that deletes all members of the array.
I tried the following sub:
So I have:
Public Class Form1
Inherits System.Windows.Forms.Form
...
Dim waitlist() As String
...
Sub ResetWaitList(ByRef waitlist() As String)
waitlist(100)
...
End Sub
It gives me the error "ReDim statement requires a parenthesized list of the new bounds of each dimension in the array". While I can dim a boundless array, it seems I cannot redim one.
I also tried the following:
Public Class Form1
Inherits System.Windows.Forms.Form
...
Dim waitlist() As String
...
Sub ResetWaitList(ByRef waitlist() As String)
Erase waitlist
Dim waitlist() As String
End Sub
Which then gives me the error "'waitlist' is already declared as a parameter in this method", even though I just erased.
How can I empty/erase/dim/redim/whatever a class-level boundless array from a sub procedure?
Thanks.
I tried the following sub:
So I have:
Public Class Form1
Inherits System.Windows.Forms.Form
...
Dim waitlist() As String
...
Sub ResetWaitList(ByRef waitlist() As String)
waitlist(100)
...
End Sub
It gives me the error "ReDim statement requires a parenthesized list of the new bounds of each dimension in the array". While I can dim a boundless array, it seems I cannot redim one.
I also tried the following:
Public Class Form1
Inherits System.Windows.Forms.Form
...
Dim waitlist() As String
...
Sub ResetWaitList(ByRef waitlist() As String)
Erase waitlist
Dim waitlist() As String
End Sub
Which then gives me the error "'waitlist' is already declared as a parameter in this method", even though I just erased.
How can I empty/erase/dim/redim/whatever a class-level boundless array from a sub procedure?
Thanks.