Help..Newbie needs help with collections...and arrays 
Author Message
 Help..Newbie needs help with collections...and arrays

Hi,

My problem is simple but i cant seem to get it right,

I want a collection to hold  2 dim arrays...simple right...

This is what i tried...

Dim col As New Collection
Dim myarray(1 To 10, 1 To 10) As Integer

Private Sub Form_Load()

myarray(1, 1) = 10
col.Add (myarray)                  >    i add an array 2 times
col.Add (myarray)
Debug.Print col.Count          > just to make sure there are two items there

Debug.Print col.Item(1)(1, 1)         > prints  10 like it should
Debug.Print col.Item(2)(1, 1)         > prints 10 like it should also

col.Item(1)(1, 1) = 99                        > here is where i think the
problem is
col.Item(2)(1, 1) = 100                      THIS SHOULD WORK  right?
Debug.Print col.Item(1)(1, 1)         > prints 10 instead of 99
Debug.Print col.Item(2)(1, 1)         > prints ten instead of 100

What did i do wrong....?    can i do this?  if i put them in a user type var
then store
them would that help.... ?   how can i set a value in the array in the
collection...


Sorry for the double post i forgot my e-mail address in the first one...



Tue, 25 Jan 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. need help converting request.form collection to an array for sorting - newbie

2. need help on collections of doubles to simulate arrays

3. Newbie needs help with qbasic array :(

4. Newbie needs help with arrays please

5. newbie needs help with an array (I think!)

6. Newbie needing help badly!! Please help

7. HELP! Newbie needs help with SQL for VB3

8. Please Help Newbie Crystal Report / VB help needed.

9. HELP - Newbie needs help on simple problem!

10. Newbie needs help running help file

11. Need Help on Array Functions and Help File

12. Help -- Loop, Array, Collection??

 

 
Powered by phpBB® Forum Software