Re: Arrays as parameters

Robert Lee <[email protected]> Sat, 21 Jun 2008 15:35:14 -0400
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Message-ID <006a01c8d3d5$ede37220$c9aa5660$@net>
I primarily develop in VB and am not as fluent in C#, so excuse me if I miss
something here, but I think that this is what you are looking for:


        private string[] myArray;
        public string MyArray
        {
            get { return myArray(index); }
            set { myArray(index) = value; }
        }

HTH,
Rob

-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps and
controls [mailto:[email protected]] On Behalf Of Steve
Abaffy
Sent: Monday, June 16, 2008 3:17 PM
To: [email protected]
Subject: [DOTNET-WINFORMS] Arrays as parameters

Hello,

        How does one do the following:

Class Someclass{

        Private string [] myarray;

        Public string [] MyArray {get { return myarray[];} set{myarray[]=
value;}}
}
Correctly? I want to be able to declare this class in my main function and
set the parameters of the myarray as

Someclass Sc = new someclass;
Sc.MyArray[0] = "This is test 1";
Sc.MyArray[1] = "Thisis test 2";
Etc...

Thanks