|
-
March 4th, 2008, 11:03 PM
#1
Array in C#
What is the equivalent code for this?
Code:
private procList As New ArrayList()
I have a problem in accessing the array list in c#.
please help.
thank you.
-
March 4th, 2008, 11:22 PM
#2
Re: Array in C#
I would use:
List<type> x = new List<type>();
eg. List<string> x = new List<string>();
...
or
ArrayList al = new ArrayList();
or
string[] sa = new string[];
Cheers,
Jon
-
March 5th, 2008, 12:17 AM
#3
Re: Array in C#
 Originally Posted by jon.borchardt
I would use:
List<type> x = new List<type>();
eg. List<string> x = new List<string>();
...
or
ArrayList al = new ArrayList();
or
string[] sa = new string[];
It doesn't work!
Coz i want that to implement it here.
Code:
private procList = new ArrayList();
if ((procList != null))
{
int i;
for (i = 0; i <= procList.Count - 1; i++)
{
KingLeon.Help.CloseHelp((Diagnostics.Process)procList(i));
}
}
How would I do that?
-
March 5th, 2008, 01:04 AM
#4
Re: Array in C#
I need more info
why cant you use a generic?
it is because the api requires an arraylist?
if so, why can you not just use an arraylist?
what is not working?
Cheers,
Jon
-
March 5th, 2008, 03:26 AM
#5
Re: Array in C#
KingLeon.Help.CloseHelp((Diagnostics.Process)procList(i));
should be
KingLeon.Help.CloseHelp((Diagnostics.Process)procList[i]);
problem is that you are using some vb syntax thing
-
March 5th, 2008, 07:14 AM
#6
Re: Array in C#
 Originally Posted by pre_wreck
What is the equivalent code for this?
Code:
private procList As New ArrayList()
I have a problem in accessing the array list in c#.
please help.
thank you.
Equivalent is
Code:
private ArrayList procList = new ArrayList();
and you will use it as
Code:
procList.Add(someObject);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|