Windows Scripting
  Home arrow Windows Scripting arrow VBScript: Array Functions
Iron Speed
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

VBScript: Array Functions
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2008-05-05

    Table of Contents:
  • VBScript: Array Functions
  • Arrays
  • Multi-Dimensional Arrays
  • Array Functions
  • UBound and LBound
  • The Join Function

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    VBScript: Array Functions
    (Page 1 of 6 )

    In our last VBScript tutorial we covered the string functions that VBScript has to offer. While there aren’t quite as many Array functions as there were with the earlier date functions, never fear: I still haven’t covered the formatting, string, conversion, and other functions. So get ready, because (as usual) we still have plenty of ground to cover.

    An Array of Arrays

    If you have made it his far in the series then you no doubt know all about variables and arrays. But just in case, I will briefly cover them here. Feel free to skip to the section labeled VBScript Array Functions if you are familiar with variables and arrays and do not need a refresher. Or if you enjoy the pain, read on!

    Variables

    Variables are containers in which you store data. In that sense, they're similar to a box. You can put data in them, you can take data out and put it back in, you can take data out and put new data in, or you can delete the data within them. They are called variables because the data within them varies.

    You declare variables in VBScript with the Dim statement. Here, we will declare some variables and give them a value:

    <html>

    <body>

    <script type="text/vbscript">

    Dim firstVariable

    Dim secondVariable

    firstVariable="13"

    secondVariable="James"

    </script>

    </body>

    </html>

    The above code creates two variables, one namedfirstVariableand the other named secondVariable. We then store data in each one (13 and James respectively). Now let's do something with those variables:


    <html>

    <body>

    <script type="text/vbscript">

    Dim firstVariable

    Dim secondVariable

    firstVariable = 13

    secondVariable = "James"

    document.write("My IQ is " & firstVariable)

    document.write("<br />My name is " & secondVariable)

    </script>

    </body>

    </html>

    The above code would print the following to the browser:

      My IQ is 13

      My name is James

    You can also declare variables and use them in this manner:


    <html>

    <body>

    <script type="text/vbscript">

    Dim firstVariable, secondVariable

    firstVariable = 13

    secondVariable = "James"

    document.write("My IQ is " & firstVariable)

    document.write("<br />My name is " & secondVariable)

    </script>

    </body>

    </html>

    You get the same result, but save space by declaring the variables on the same line.

    More Windows Scripting Articles
    More By James Payne


       · Thanks for stopping by to read my article. In this episode we discuss Array and...
     

    WINDOWS SCRIPTING ARTICLES

    - VBScript: Array Functions
    - VBScript: Strings, You Can`t Function withou...
    - VBScript: More String Functions
    - VBScript: Functioning with Strings
    - Working with the Windows Registry in C++
    - Understanding Objects
    - HTML Applications: Giving WSH a User Interfa...
    - Modifying Computer Objects with Active Direc...
    - Logon Script to Send Email Notifications
    - Securing Computers and Active Directory
    - Moving and Renaming Computers with Active Di...
    - Working with System Processes in WSH
    - Active Directory and Computers
    - WCF and Proxies
    - Metadata and WCF Essentials




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway