David,

I believe, yes, you have to use an ArrayList. This has the functionality
that you want if you want to dynamically add to your array without
worrying about resizing your array.

Noli

-----Original Message-----
From: David B. Bitton [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 10:25 PM
To: [EMAIL PROTECTED]
Subject: [DOTNET] add Array items


I'd moving VB6 to C#.  Back in the day, I used Redim Preserve to add
items
to an array.  Obviously this is no longer valid.  I took a look at the
Array
class an I noticed that it implements the IList interface.
Unfortunately, I
can't seem to get the Add() method to work.  This fails compilation:

int bar = foo.Add(i);

foo being an array defined as such:

int[] foo = new int[]{};

Do i want to use an ArrayList instead?

--

David B. Bitton
[EMAIL PROTECTED]
www.codenoevil.com

Code Made Fresh DailyT

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to