Developing Web Applications

Previous Topic Next Topic

Making Off-by-One Errors with Collections

Not all collections in VBScript begin with element 1. Some collections—the ADO Fields collection, for example—start at element 0. When looping through a complete collection, it is often safest to use the VBScript methods LBound and UBound to specify the starting and ending array indexes, respectively. Note that JScript also defines these methods on its VBArray object.


© 1997-1999 Microsoft Corporation. All rights reserved.