BrainDump
  Home arrow BrainDump arrow Page 6 - VBScript: Functions and Loops
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 
Mobile Linux 
App Generation ROI 
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: Functions and Loops
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2007-12-17

    Table of Contents:
  • VBScript: Functions and Loops
  • Sub Procedures
  • Loop Flakes...They're Great!
  • The For Each...Next Loop
  • Do Loop
  • Do Until

  • 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: Functions and Loops - Do Until


    (Page 6 of 6 )

    If you wanted to execute some code until a certain condition became true, you could use the Until Keyword, like so:


    <html>

    <body>

    <script type="text/vbscript">

    i=1

    do Until i=10

    document.write("Beer!" & "<br />")

    i=i+1

    Loop

    </script>

    </body>

    </html>

    Again the result:

      Beer!
      Beer!
      Beer!
      Beer!
      Beer!
      Beer!
      Beer!
      Beer!
      Beer!

    And we can, of course, force this code to execute AT LEAST once as well:


    <html>

    <body>

    <script type="text/vbscript">

    i=10

    do

    document.write("Beer!" & "<br />")

    i=i+1

    Loop until i=10

    </script>

    </body>

    </html>

    Since the value begins at 10, here is the result:

      Beer!

    While that isn't everything there is to know about loops and functions, it is a good start, and I am currently all out of time. My next VBScript tutorial will discuss some of the different types of functions in VBScript, like array and date functions, and go more in-depth on how to use them. So check back often.

    Till then...


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    BRAINDUMP ARTICLES

    - Internet Explorer 8 Review
    - Nilpo`s Top Windows Add-Ons
    - Beginning Silverlight 2.0 Development using ...
    - Fixing Vista`s Troubles
    - Preparing Windows Images for Mass Deployment
    - The Trouble With Vista
    - Slipstreamed and Unattended Windows Installa...
    - 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





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