p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

vb_certification thread: Re: One says A and the other says C.


Message #1 by Polash <polash@a...> on Sun, 08 Jul 2001 20:46:49 -0700
Always is a rather strong word.  If it was always, then the question
wouldn't even need asked.  The fact is that Microsoft chose in VB to have 0
based and 1 based collections and you have to know what is 0 based and what
is 1 based.  A perfect example of this is the ImageList control.  It's a
very common mistake for a developer that is attempting animation with the
ImageList control to improperly write code that, when the counter used to
refer to the index increments past the last image in the ImageList, reset
the counter to 0.  A reference to ImageList1.ListImages(0) will result in an
"Index out of bounds" error.

I've deleted the original message and don't have the actual code questioned
anymore, but I believe when I ran the examples that it was the code that
used a 1 based system that ran without error.

-----Original Message-----
From: Wave [mailto:wave1102001@y...]
Sent: Tuesday, July 10, 2001 10:34 PM
To: vb_certification
Subject: [vb_certification] Re: One says A and the other says C.


A is correct because an index of a collection always start with value 0.


  Return to Index