Implement a "var.Add(...)"? 
Author Message
 Implement a "var.Add(...)"?

I have a class that I wish to use a linked list with (ArrayList will even do).

In the same spirit as a ListBox, I wish to use a variable in such that I can do:
varname.Add("path_to_file_name", order);

Or am I talking already an ArrayList?  If I am then how can I do:
...
Class1 cs = new Class1()

cs.varname.Add("text-goes-here",order);
...

Or have I answered my own question in so much that I declare in Class1:
public ArrayList varname = new ArrayList();

TIA
Wayne



Sat, 18 Dec 2004 18:15:29 GMT  
 Implement a "var.Add(...)"?
Wayne,

    The Add method on the ListBox.ObjectCollection only takes one argument.
Is the other argument a key for the value?  If this is the case, then you
might want to look into the Hashtable, and not the ArrayList.

    Hope this helps.

--
               - Nicholas Paldino [.NET MVP]


Quote:
> I have a class that I wish to use a linked list with (ArrayList will even
do).

> In the same spirit as a ListBox, I wish to use a variable in such that I
can do:
> varname.Add("path_to_file_name", order);

> Or am I talking already an ArrayList?  If I am then how can I do:
> ...
> Class1 cs = new Class1()

> cs.varname.Add("text-goes-here",order);
> ...

> Or have I answered my own question in so much that I declare in Class1:
> public ArrayList varname = new ArrayList();

> TIA
> Wayne



Sat, 18 Dec 2004 20:45:53 GMT  
 Implement a "var.Add(...)"?
Wayne,

    The Add method on the ListBox.ObjectCollection only takes one argument.
Is the other argument a key for the value?  If this is the case, then you
might want to look into the Hashtable, and not the ArrayList.

    Hope this helps.

--
               - Nicholas Paldino [.NET MVP]


Quote:
> I have a class that I wish to use a linked list with (ArrayList will even
do).

> In the same spirit as a ListBox, I wish to use a variable in such that I
can do:
> varname.Add("path_to_file_name", order);

> Or am I talking already an ArrayList?  If I am then how can I do:
> ...
> Class1 cs = new Class1()

> cs.varname.Add("text-goes-here",order);
> ...

> Or have I answered my own question in so much that I declare in Class1:
> public ArrayList varname = new ArrayList();

> TIA
> Wayne



Sat, 18 Dec 2004 20:48:37 GMT  
 Implement a "var.Add(...)"?


Quote:
> Wayne,

>     The Add method on the ListBox.ObjectCollection only takes one argument.
> Is the other argument a key for the value?  If this is the case, then you
> might want to look into the Hashtable, and not the ArrayList.

I noticed that when I was playing around after I posted.  The ArrayList is fine
for my basic need at the moment, but I will look at expanding it into the
hashtable once I read up on it.

Quote:
>     Hope this helps.

It did - thanks.


Sun, 19 Dec 2004 07:44:48 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. scanf("%c", &var) behavior!!

2. implementing "ls eli*"

3. implementing "complete" comparison

4. implementing "trace" in c

5. Question on implementing "repeat...until keypress"?

6. Rules for "implements" in VB

7. "Implement Connection Point..." option is missing

8. implement a "kill" with signals

9. How to implement "autometic statement completion"?

10. Implementing "cp" shell command

11. How to implement "Multiway Serch Tree"?

12. Implementing "ls" from within C

 

 
Powered by phpBB® Forum Software