.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 5
Anonymous
167 Views, 4 Replies

Add method

Is there a simple way to initialize an array list with several items rather
than using the add method for each item? In the following example it would
be nice to add all items with one add call.

fa_FrenchDoors.Add("FDOR")

fa_FrenchDoors.Add("FPAR")

fa_FrenchDoors.Add("FAES")

fa_FrenchDoors.Add("FAEL")

fa_FrenchDoors.Add("FAED")

fa_FrenchDoors.Add("FAER")

fa_FrenchDoors.Add("FAES")

fa_FrenchDoors.Add("FAED")

fa_FrenchDoors.Add("BDE2")
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

ArrayList a = new ArrayList(new string[] {"a", "b", "c"});


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Dale Levesque" wrote in message news:4984952@discussion.autodesk.com...
Is there a simple way to initialize an array list with several items rather
than using the add method for each item? In the following example it would
be nice to add all items with one add call.

fa_FrenchDoors.Add("FDOR")

fa_FrenchDoors.Add("FPAR")

fa_FrenchDoors.Add("FAES")

fa_FrenchDoors.Add("FAEL")

fa_FrenchDoors.Add("FAED")

fa_FrenchDoors.Add("FAER")

fa_FrenchDoors.Add("FAES")

fa_FrenchDoors.Add("FAED")

fa_FrenchDoors.Add("BDE2")
Message 3 of 5
Anonymous
in reply to: Anonymous

Excellent.

"Tony Tanzillo" wrote in message
news:4985046@discussion.autodesk.com...
ArrayList a = new ArrayList(new string[] {"a", "b", "c"});


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Dale Levesque" wrote in message
news:4984952@discussion.autodesk.com...
Is there a simple way to initialize an array list with several items rather
than using the add method for each item? In the following example it would
be nice to add all items with one add call.

fa_FrenchDoors.Add("FDOR")

fa_FrenchDoors.Add("FPAR")

fa_FrenchDoors.Add("FAES")

fa_FrenchDoors.Add("FAEL")

fa_FrenchDoors.Add("FAED")

fa_FrenchDoors.Add("FAER")

fa_FrenchDoors.Add("FAES")

fa_FrenchDoors.Add("FAED")

fa_FrenchDoors.Add("BDE2")
Message 4 of 5
Anonymous
in reply to: Anonymous

Just having abit of trouble converting to VB .net though : ) I'm assuming
this is C# Tony?

"Tony Tanzillo" wrote in message
news:4985046@discussion.autodesk.com...
ArrayList a = new ArrayList(new string[] {"a", "b", "c"});


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Dale Levesque" wrote in message
news:4984952@discussion.autodesk.com...
Is there a simple way to initialize an array list with several items rather
than using the add method for each item? In the following example it would
be nice to add all items with one add call.

fa_FrenchDoors.Add("FDOR")

fa_FrenchDoors.Add("FPAR")

fa_FrenchDoors.Add("FAES")

fa_FrenchDoors.Add("FAEL")

fa_FrenchDoors.Add("FAED")

fa_FrenchDoors.Add("FAER")

fa_FrenchDoors.Add("FAES")

fa_FrenchDoors.Add("FAED")

fa_FrenchDoors.Add("BDE2")
Message 5 of 5
Anonymous
in reply to: Anonymous

According to reflector:

Dim a As New ArrayList( New String() {"a", "b", "c"} )


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Dale Levesque" wrote in message news:4985110@discussion.autodesk.com...
Just having abit of trouble converting to VB .net though : ) I'm assuming
this is C# Tony?

"Tony Tanzillo" wrote in message
news:4985046@discussion.autodesk.com...
ArrayList a = new ArrayList(new string[] {"a", "b", "c"});


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Dale Levesque" wrote in message
news:4984952@discussion.autodesk.com...
Is there a simple way to initialize an array list with several items rather
than using the add method for each item? In the following example it would
be nice to add all items with one add call.

fa_FrenchDoors.Add("FDOR")

fa_FrenchDoors.Add("FPAR")

fa_FrenchDoors.Add("FAES")

fa_FrenchDoors.Add("FAEL")

fa_FrenchDoors.Add("FAED")

fa_FrenchDoors.Add("FAER")

fa_FrenchDoors.Add("FAES")

fa_FrenchDoors.Add("FAED")

fa_FrenchDoors.Add("BDE2")

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost