BrainDump
  Home arrow BrainDump arrow Understanding Variables in VBScript
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? 
BRAINDUMP

Understanding Variables in VBScript
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2008-03-18

    Table of Contents:
  • Understanding Variables in VBScript
  • Variable Names and Scope
  • Initializing and Debugging Variables
  • Data types

  • 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

    Ajax Application Generator Generate database 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!

    Understanding Variables in VBScript
    (Page 1 of 4 )

    In VBScript, as with any programming language, it is extremely important to familiarize yourself with variables and how they work. Variable usage in VBScript is highly simplified, but before we begin, let’s take a look at what variables are exactly.

    Much like their mathematical cousins, in programming, variables are used to reference some piece of data.  In programming, that data is stored in memory and a variable serves as a reference to the memory address where the data is located.

    As their name implies, variables are dynamic.  Values can be assigned and reassigned at any time throughout their lifespan.  Unlike some other programming languages, variables in VBScript do not need to have a value assigned to them when they are initialized, although this is a common practice.

    Understand the difference between variables and constants:  the value of a variable can be changed while the value of a constant cannot be changed once it has been initialized.

    You should also be aware of data types.  As with any programming language, multiple data types exist, however, all variables are of type Variant.  This means that you do not need to declare a data type when initializing a variable and that you may change the data type associated with it at any time.

    This comes as both a blessing and a curse.  On one hand, you can perform data type conversions on the fly, which can prevent a lot of runtime errors.  On the other hand, these “behind the scenes” conversions can often produce some pretty unexpected results.

    More BrainDump Articles
    More By Nilpo


       · If you plan to master any programming language, it's a good practice to develop a...
     

    BRAINDUMP ARTICLES

    - Multiple Service Contracts and Indigo
    - Cleaning Out Your Programs in XP
    - Handling Metadata with Indigo
    - Building Blocks for a WCF Service Web Site
    - Help! I Need Some Remote Assistance
    - Using Service Templates with Indigo
    - Windows XP Tips for Task Manager
    - Generating Clients and Services with Indigo
    - Vista SP1, A Review
    - Services and the WCF
    - VBScript: Final Date Functions
    - Creating Services with the WCF
    - The Resource View of the MFC
    - VBScript: More Fun with the Date Functions
    - Vista Price Cuts Dissected

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




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