Working With Arrays in VBScript
(Page 1 of 5 )
As you progress to more and more complicated scripts, you will undoubtedly find yourself working with some form of data—perhaps a group of files, entries in a text file, or a group of dates. The possibilities are limitless. In any case, VBScript provides a few different facilities for handling and manipulating whatever kind of data you might be working with.
I’m quite sure you’ll find this explanation to be a bit vague, and that’s okay. We’re going to jump right in and you’ll be up to speed in no time at all once you see these concepts in action.
We’ll begin by examining arrays. An array is essentially VBScript’s list mechanism—a group of data items that are assigned to a single variable reference. Many languages limit arrays to containing only text strings. In VBScript, however, all variables are of type variant by default. This extends to the array, which can house any data types, since they too are of type variant.
This means you could have an array of text strings -- several text elements all assigned to the same variable reference. You can also have an array of integer data. More importantly, since we’re working with variants, you can have an array that mixes more than one data type. Let’s take a look at how to create some arrays so you can see what we’re dealing with.
Next: Creating Arrays >>
More Windows Scripting Articles
More By Nilpo