Add method

Add method

Anonymous
Not applicable
471 Views
4 Replies
Message 1 of 5

Add method

Anonymous
Not applicable
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")
0 Likes
472 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
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")
0 Likes
Message 3 of 5

Anonymous
Not applicable
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")
0 Likes
Message 4 of 5

Anonymous
Not applicable
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")
0 Likes
Message 5 of 5

Anonymous
Not applicable
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")
0 Likes