We are independent & ad-supported. We may earn a commission for purchases made through our links.

Advertiser Disclosure

Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.

How We Make Money

We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently from our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.

What are Arrays in VBScript?

By Page Coleman
Updated May 17, 2024
Our promise to you
WiseGEEK is dedicated to creating trustworthy, high-quality content that always prioritizes transparency, integrity, and inclusivity above all else. Our ensure that our content creation and review process includes rigorous fact-checking, evidence-based, and continual updates to ensure accuracy and reliability.

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

Editorial Standards

At WiseGEEK, we are committed to creating content that you can trust. Our editorial process is designed to ensure that every piece of content we publish is accurate, reliable, and informative.

Our team of experienced writers and editors follows a strict set of guidelines to ensure the highest quality content. We conduct thorough research, fact-check all information, and rely on credible sources to back up our claims. Our content is reviewed by subject matter experts to ensure accuracy and clarity.

We believe in transparency and maintain editorial independence from our advertisers. Our team does not receive direct compensation from advertisers, allowing us to create unbiased content that prioritizes your interests.

Arrays in VBScript are functions that create specific kinds of variables which can increase a script’s flexibility. Much like they are used in algebra, variables as they are used in programming are placeholders for values. The algebraic expression x + y = z is an example of the use of variables. In this example, the x may be set to equal any number. Similarly, when using an array, the value of the variable can change, and it does not need to be hard-coded.

VBScript is a Microsoft® scripting language that is related to Visual Basic and Active Scripting, which was originally called ActiveX. Web developers may use VBScript in client-side scripting for the Internet Explorer® browser. It can also be used for server-side scripting in an ASP.Net environment. Windows system administrators may use VBScript because it can be used for interacting with the Windows Component Object Model (COM) as well as for automating some system maintenance tasks.

This scripting language allows for up to 60 positions, or dimensions, to be used in its arrays. Arrays in VBScript begin with the number 0 for element indexing, which indicates the position within the array. The 0 will indicate the first position, the number 1 will indicate the second position, and so on.

There are two types of arrays in VBScript. The first type is a static array. This is the simplest type. When using this array, the programmer defines the size of the index, which is the maximum number of elements, of the array up front, and it will not change.

A more flexible and useful array type is the dynamic array. A dynamic array allows the size of the array to change as the script is executed. An extension of the dynamic array is a multidimensional array. With this convention, a programmer can establish an array with two or more dimensions.

Regardless of type, VBScript provides a number of functions for use with arrays. These functions ease some common tasks, such as joining or splitting data in arrays. VBScript also offers a loop statement that can be used to move through each element in an array.

Some common programming tasks may make use of the loop function. Arrays in VBScript may be used to export data from one file to another. A script may take data entered on an HTML form, store it in arrays, and then use that data elsewhere on a website. One other useful task involves writing a script to connect to a database, and then to use the array function to display data on a web page or other screen.

WiseGEEK is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.

Discussion Comments

WiseGEEK, in your inbox

Our latest articles, guides, and more, delivered daily.

WiseGEEK, in your inbox

Our latest articles, guides, and more, delivered daily.