jagguy
asked on
pass array of strings
how do i pass an array of string as a class parameter?
I want to cycle through the passed array of string by index as well.
I want to cycle through the passed array of string by index as well.
is this correct to receive a array of strings in vb.net?
Dim _mystrings(10) As String
Public Sub New(ByVal mystrings() As String)
_mystrings(0) = mystrings(0)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
*** NOT FOR POINTS ***
Just FYI, the loop can also be written as:
For n As Integer = 0 To mystrings.GetUpperBound(0)
' do something with mystrings(n) here
Next
Just FYI, the loop can also be written as:
For n As Integer = 0 To mystrings.GetUpperBound(0)
' do something with mystrings(n) here
Next
Because this is not the default constructor you need to also call InitializeComponent if this is a Form class.
Dim _mystrings(10) As String
Public Sub New(ByVal mystrings() As String)
InitializeComponent()
_mystrings(0) = mystrings(0)
End Sub
Fernando