opensubscriber
   Find in this group all groups
 
Unknown more information…

d : dotnet-winforms@discuss.develop.com 24 June 2008 • 10:17PM -0400

Re: Arrays as parameters
by samir parekh

REPLY TO AUTHOR
 
REPLY TO GROUP




Why dont you use ArrayList , its a perfect solution when you dont know the size of array you will be passing or you might go further with a List<string> which is strongly typed string arraylist.

Since it is a list it is DMA and can grow as much as you like.

if they are named params I used to passon a stringdictionary or Dictionary<string,string> iwth default values prepopulated and the replace the values from the commandline to the default values, in this way your prog always has some data / param values to operate on.


Regards
sam

Regards
sam








--- On Tue, 6/17/08, Steve Abaffy <steve@MSMA...> wrote:
From: Steve Abaffy <steve@MSMA...>
Subject: [DOTNET-WINFORMS] Arrays as parameters
To: DOTNET-WINFORMS@DISC...
Date: Tuesday, June 17, 2008, 12:47 AM

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

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

opensubscriber is not affiliated with the authors of this message nor responsible for its content.