Windows Scripting
  Home arrow Windows Scripting arrow Understanding Procedures in VBScript
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? 
WINDOWS SCRIPTING

Understanding Procedures in VBScript
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 2
    2008-07-14

    Table of Contents:
  • Understanding Procedures in VBScript
  • Subs and Functions
  • Using Parameters
  • More on Scopes and Parameters
  • Final Concepts

  • 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


    Understanding Procedures in VBScript


    (Page 1 of 5 )

    In programming, procedures are code structures that contain reusable code. Instead of recreating the series of statements over and over again, you can package your code in a procedure and call that procedure whenever you want that code group to execute. In short, procedures can be used as a way to simplify your code.

    Using procedures in your code is a programming technique known as modularizing.  Modularized code is easier to read and often easier to work with.  Modularizing your code can also aid in debugging by reducing the number of possible error points.

    So what types of statements can be modularized into procedures?  Well, simply put, any of them.  However, procedures should be used to group similar or related statements for a specific purpose or task.  Then you can call that procedure anytime that you need to perform the given task without having to recreate each of the steps required.

    Take for instance a script that checks your email box for new emails.  You first need to connect to the mail server.  Then, you need to determine whether or not there are new mails.  Finally, you need to return a value that indicates whether or not new mail exists.

    Rather than recreating these steps, you could package them in a procedure called CheckNewMail.  Then, you could simply call the CheckNewMail procedure any time you wanted to know if new mail existed.

    Learning to properly implement procedures is a necessary step as you progress as a programmer.  Understanding these procedures is also necessary when using external objects or classes.  Now that you have a basic understanding of what procedures are, let’s take a look at the different procedures offered by VBScript and create a few working examples.

    More Windows Scripting Articles
    More By Nilpo


       · Procedures are an essential part of dynamic programming. Learn how these tools can...
     

    WINDOWS SCRIPTING ARTICLES

    - A Portable Scripting Toolbox
    - WPF Through an Example: Introduction
    - Beginning SharePoint Web Part Development
    - More Alternative Languages for WSH
    - WPF Control Layout
    - WSH in Other Languages
    - Screen Capturing via GDI+ and GDI
    - Understanding Procedures in VBScript
    - Printing Documents in WSH
    - Generating Outlook Signatures Based on Activ...
    - VBScript: Converting and Formatting with Fun...
    - VBScript: Conversion and Format Functions
    - VBScript: Array Functions
    - VBScript: Strings, You Can`t Function withou...
    - VBScript: More String Functions





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