using collection for more than one parameter

using collection for more than one parameter

Anonymous
Not applicable
409 Views
7 Replies
Message 1 of 8

using collection for more than one parameter

Anonymous
Not applicable
i got a set of data. x,y,z coordinate and an identifier text string. i created a collection Dim liste_text As New Collection liste_text.Add nokta(0), yazi 'x coordinate of the text string. how am i gonna add the nokta(1) and nokta(2) to that collection. any idea? thnx.
0 Likes
410 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Concantenate them together -> Dim s As String s = CStr(1.0) & "|" & CStr(1.0) & "|" & CStr(0.0) then add to the collection. When you need to use them, split them back apart. -- Mike ___________________________ Mike Tuersley CADalyst's CAD Clinic Rand IMAGINiT Technologies ___________________________ the trick is to realize that there is no spoon...
0 Likes
Message 3 of 8

Anonymous
Not applicable
Hi fischer You can add a point array to the collection: liste_text.Add nokta, yazi Cheers -- Juerg Menzi MENZI ENGINEERING GmbH, Switzerland http://www.menziengineering.ch
0 Likes
Message 4 of 8

Anonymous
Not applicable
if id like create a list in a loop just like in autolisp - the "list" command. do i have to use arrays or collection sets. which one is better for manipulating. id like to add/remove/call this list item outside the loop. thnx. ps : i added the point array but could not call back with a=liste_text.item (yazi) "Jürg Menzi" wrote in message news:41557E29.463AD5F2@menziengineering.ch... > Hi fischer > > You can add a point array to the collection: > > liste_text.Add nokta, yazi > > Cheers > -- > Juerg Menzi > MENZI ENGINEERING GmbH, Switzerland > http://www.menziengineering.ch
0 Likes
Message 5 of 8

Anonymous
Not applicable
Dim a, b b = Array() for ..... yazi = sset.Item(i).TextString nokta = sset.Item(i).InsertionPoint 'insertion points of texts selected from model space noktax = CStr(nokta(0)) noktay = CStr(nokta(1)) noktaz = CStr(nokta(2)) a = Array(yazi, noktax, noktay, noktaz) b = join(a) next ........ debug.print b(n) 'n any number that is between 0 and ubound(b) i got nothing. "Jürg Menzi" wrote in message news:41557E29.463AD5F2@menziengineering.ch... > Hi fischer > > You can add a point array to the collection: > > liste_text.Add nokta, yazi > > Cheers > -- > Juerg Menzi > MENZI ENGINEERING GmbH, Switzerland > http://www.menziengineering.ch
0 Likes
Message 6 of 8

Anonymous
Not applicable
Hi fischer Sample 1: [code] Sub Sample1() Dim Col As New Collection Dim Pnt(0 To 2) As Double Pnt(0) = 1# Pnt(1) = 2# Pnt(2) = 3# Col.Add Pnt, "First" Debug.Print Col.Item("First")(0) Debug.Print Col.Item("First")(1) Debug.Print Col.Item("First")(2) End Sub [/code] Sample 2: [code] Sub Sample2() Dim Col As New Collection Dim Pnt(0 To 3) As Variant Pnt(0) = "First" Pnt(1) = 1# Pnt(2) = 2# Pnt(3) = 3# Col.Add Pnt Debug.Print Col.Item(1)(0) Debug.Print Col.Item(1)(1) Debug.Print Col.Item(1)(2) Debug.Print Col.Item(1)(3) End Sub [/code] Cheers -- Juerg Menzi MENZI ENGINEERING GmbH, Switzerland http://www.menziengineering.ch
0 Likes
Message 7 of 8

Anonymous
Not applicable
got it thnx alot. muy bueno. vielen dank. "Jürg Menzi" wrote in message news:4156D506.EB20DC1C@menziengineering.ch... > Hi fischer > > Sample 1: > [code] > Sub Sample1() > > Dim Col As New Collection > Dim Pnt(0 To 2) As Double > > Pnt(0) = 1# > Pnt(1) = 2# > Pnt(2) = 3# > > Col.Add Pnt, "First" > > Debug.Print Col.Item("First")(0) > Debug.Print Col.Item("First")(1) > Debug.Print Col.Item("First")(2) > > End Sub > [/code] > > Sample 2: > [code] > Sub Sample2() > > Dim Col As New Collection > Dim Pnt(0 To 3) As Variant > > Pnt(0) = "First" > Pnt(1) = 1# > Pnt(2) = 2# > Pnt(3) = 3# > > Col.Add Pnt > > Debug.Print Col.Item(1)(0) > Debug.Print Col.Item(1)(1) > Debug.Print Col.Item(1)(2) > Debug.Print Col.Item(1)(3) > > End Sub > [/code] > > Cheers > -- > Juerg Menzi > MENZI ENGINEERING GmbH, Switzerland > http://www.menziengineering.ch
0 Likes
Message 8 of 8

Anonymous
Not applicable
Hi fischer Welcome... Je vous enprie... Gern geschehen... Cheers...¦-) -- Juerg Menzi MENZI ENGINEERING GmbH, Switzerland http://www.menziengineering.ch
0 Likes