doing something wrong as the last for next loop errors out. can someone tell me what i am doing wrong?
it errors out on the print statementPlease Login or Register to view this content.
doing something wrong as the last for next loop errors out. can someone tell me what i am doing wrong?
it errors out on the print statementPlease Login or Register to view this content.
What are you expecting it to print? Currently you've told it to print an object, which won't work. It's also generally better to use a For Each loop with a collection.
Rory
thanks @rorya
yup, i see that now. so i changed the code to this:
but now its printing the same Name 312 times, can you tell me why?Please Login or Register to view this content.
so i changed the for next loop to a for each loop like so, but still getting the same name printed 312 times
Please Login or Register to view this content.
You're adding the same object each time.
First off, never use Dim ... As New ...
Dim the variable normally, then use:
inside your loop, so that you create a new instance each time, and add that to the collection.Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks