BrainDump
  Home arrow BrainDump arrow Page 5 - VBScript: Multidimensional Arrays, Stateme...
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 
Moblin 
JMSL Numerical Library 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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? 
BRAINDUMP

VBScript: Multidimensional Arrays, Statements, and Commenting
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2007-12-10

    Table of Contents:
  • VBScript: Multidimensional Arrays, Statements, and Commenting
  • Dynamic Arrays
  • Conditional Statements
  • If...Then...Elseif
  • The Select Case
  • Commenting Your Code

  • 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
     
     
    ADVERTISEMENT


    VBScript: Multidimensional Arrays, Statements, and Commenting - The Select Case


    (Page 5 of 6 )

    As an alternative to the Elseif statement you could use the Select Case statement, which saves time and space in a program and is easier to read. Here is a sample program based off of our previous program:


    <html>

    <body>

    <script type="text/vbscript">

    Dim sitcom

    sitcom = "Greatest American Hero"

    Select Case sitcom

    Case "Alf"

    msgbox "Don't eat my cat!"

    Case "Three's Company"

    msgbox "Larry said to meet him at the Blue Oyster"

    Case "Alice"

    msgbox "Kiss my grits!"

    Case "Greatest American Hero"

    msgbox "Prepare for a crash landing"

    Case Else

    msgbox "Hey turn the tv, Alf is on!"

    End Select

    </script>

    </body>

    </html>

    This code functions in the same manner as our previous example, only it is much more efficient. You will notice that at the end of the code I used a Case Else; this isn't required, but it gives you the option of saying if none of the criteria is met, do this.

    More BrainDump Articles
    More By James Payne


       · Thanks once more for dropping by to read my article. Here we discuss Arrays,...
     

    BRAINDUMP ARTICLES

    - XAML Brushes and Silverlight
    - Silverlight and XAML Basics
    - Immortal XP
    - XAML Basics
    - Microsoft Surface
    - Making Your First Active X Control in Visual...
    - Codes and Packages in Microsoft Project 2007
    - Windows 7: Rumors and Demos
    - XP SP3 Why Me?
    - Breaking Up Your Work in Microsoft Project
    - Breaking Work into Task-Sized Chunks
    - Putting Microsoft`s Worldwide Telescope Unde...
    - Handling Multiple Contracts with Indigo
    - Cleaning Out Your Data in XP
    - Multiple Service Contracts and Indigo





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