BrainDump
  Home arrow BrainDump arrow Page 4 - 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 
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 / 3
    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 - If...Then...Elseif


    (Page 4 of 6 )

    If you want to set multiple If then Elses, you would use the ElseIf statement. Behold!


    <html>

    <body>

    <script type="text/vbscript">

    Dim sitcom

    sitcom = "Greatest American Hero"

    if sitcom = "Alf" Then

    msgbox "Don't eat my cat!"

    elseif sitcom = "Three's Company"

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

    elseif sitcom = "Alice"

    msgbox "Kiss my grits!"

    elseif sitcom = "Greatest American Hero"

    msgbox "Prepare for a crash landing"

    else

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

    End If

    </script>

    </body>

    </html>

    Again, we create a variable named sitcom and assign it a value. Then we run through a series of statements, asking if the value of sitcom is equal to Alf; if it is, the program creates a pop-up box that says "Don't eat my cat!" Otherwise it moves on to the next statement and asks, is the value equal to Three's Company? If so, it creates a pop-up that says "Larry said to meet him at the Blue Oyster." It continues on in this manner until it finds a match. Finally at the end, if no match is found, it creates a pop-up box that says: "Hey turn the tv, Alf is on!"

    However, since it does find a match, the program shows the following message in a pop-up box and exits out of the If statement:

      Prepare for a crash landing

    More BrainDump Articles
    More By James Payne


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

    BRAINDUMP ARTICLES

    - Microsoft Office SharePoint Server
    - Microsoft Office SharePoint Designer
    - Microsoft Windows SharePoint Services 3.0
    - Microsoft Live Mesh Overview
    - 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





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