Can anyone tell me why my class array has 10 items all identical to customer(10)?
dim TempCust as new classCustomer
dim i as integer
for i = 0 to 9
TempCust.name = "ABC" + i.totext
TempCust.Rate = i*101 + 0.357
TempCust.Active = true
Customers(i) = TempCust
I dimensioned the array in the declaration to be 10 elements (Customers(9))
Alternatively, I dimensioned it to (-1) and then I put this in the loop
And got same result.
I also checked it in the debugger, and every append, caused every element to update to the latest one, so the debugger progression of customers was like
then 1, 1
then 2, 2, 2
then 3, 3, 3, 3
I have spent an hour looking at the programming guide, the forum, and sample projects, and can not get this simple thing to work.