Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 715
  • Last Modified:

Pass Array to Class vb.net

How do I pass an array into a class property in VB.NET?

For example, in my class I have the following code:

    Public Property GCArray() As String
        Get
            Return Me.cGCArray()
        End Get
        Set(value As String)
            Me.cGCArray() = value
        End Set
    End Property

Open in new window


cGCArray() is created when i  split a list of strings.
I'd like to be able to access each string when using the class like this:

textVar = myClass.GCArray(x)

I'm missing something - cause my code isn't working.  Any ideas?

Thank you for your help!!!
0
slightlyoff
Asked:
slightlyoff
1 Solution
 
käµfm³d 👽Commented:
Public Property GCArray() As String()

Open in new window


Add the parens at the end.
0
 
slightlyoffAuthor Commented:
That was fast!  Thank you for your help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now