Getting a Grip on VBScript Arrays with UBound
The ubound function in VBScript returns the highest available element in an array.
In its simplest form, you enclose the name of the array in parentheses – as in ubound(SampleArray). (Note that the parentheses that contain the array subscript are left out).
In the following example code, the message box would display the number 10:
Note: To see the examples work for yourself, copy the code into notepad and save it as a *.vbs file (i.e. sample.vbs).
The ubound function can be useful in a number of situations. For example, it can simplify the logic of looping through the elements of an array.
The full syntax of ubound is: ubound(arrayname[,dimension]) . The optional dimension parameter is used in multidimensional arrays to specify which dimension is being referenced. A "1" indicates the first dimension, a "2" indicates the second dimension, ad infinitum.
See more from Web Design
Other Pages You Might Enjoy...
The Vacuum Tube in Computer History
The vacuum tube holds a particularly significant place in the evolution of electronic computing. With the invention of the triode in 1907 and a flurry of subsequent improvements, computing pioneers finally had the means to create fully electronic digital logic circuits.
Computer History Timeline
An overview of computer history featuring highlights from the earliest counting devices and astronomical calculators to the marvels of the modern age.
The Meissen Porcelain Manufactory
For more than 300 years the Meissen Porcelain Manufactory has been a central figure in European porcelain. It was at Meissen that the first true hard-paste porcelain was manufactured outside of China, and the story of that accomplishment has the high drama of fiction - all the more intriguing because it is true.
Pirated Glassware that Collectors Want to Own
The 1996 discovery of what is believed to be the wreckage of Blackbeard's ship Queen Anne's Revenge, is providing historians and collectors new information about the fragile and transparent objects that came onto the North American Continent before arrival of the first piece of cut glass.
Collecting Antique Furniture
Of all the collectible antiques, the broad category of furniture is perhaps the most widely held and most satisfying. Frequently handed down through generations, the various chairs, tables, cabinets and other pieces are often in use, adding character and constancy to our daily lives. This guide includes an overview of the significant styles and historical periods, and other important information for collectors.
Collecting Antique Clocks and Watches
Information for collectors of antique clocks and watches. Includes a history of clock and watchmaking, an overview of styles, and important terminology.
Collecting Antique Jewelry
Embodying the wealth and treasure of bygone days, the antique jewelry pieces available today include some of the world's most valuable artifacts. Includes a history of jewelry making, an overview of the major historical periods, and a glossary of antique jewelry terminology.
Home of the Do It Yourself Chatterbot Project. Has a ready to go chatterbot shell and full instructions on how to program it.
Tips for Improving Website Navigation
A business often has more than one target audience it wants to reach with its website. Different customers mean different sales appeals and a homepage needs to be able to direct visitor traffic to go to the right places to get information or make a sale.
Choosing the Right Color for Your Web Site
When people build a web site for their business (or hire a web design company to make it for them), not much thought is put into deciding what color their web site will be as most would rather focus on more important tasks like creating content, web site optimization and promotion. Most simply choose the most web-friendly colors, others use their company's logo as base while some decide to just use their favorite color.
Beginning at the Beginning - File Systems and Plain Text Files
HTML For the Absolute Beginner
The intent of this tutorial is to provide a basic introduction to making web pages for the person who has never studied HTML before. Once one has worked through this material they should be able to create a bare bones HTML file and be ready to move on to learning to build web pages.