Solved

Pass Array to Class vb.net

Posted on 2014-04-17
2
543 Views
Last Modified: 2014-04-17
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
Comment
Question by:slightlyoff
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 40006937
Public Property GCArray() As String()

Open in new window


Add the parens at the end.
0
 
LVL 1

Author Comment

by:slightlyoff
ID: 40006946
That was fast!  Thank you for your help!
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
start a process from a service 3 23
Sql server insert 13 31
How to open form using item in Listbox. 8 21
VB.net Progress Bar - Maximum Value too large 2 12
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question