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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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

    - Introduction to Office Live Workspace
    - Using MS Excel for One-way Analysis of Varia...
    - Comparing Data Sets Using Statistical Analys...
    - Import Blogger Posts into WordPress Using Wi...
    - Download WordPress from an FTP Server and Ru...
    - Install and Run WordPress in XAMPP Local Host
    - What Windows 7 Brings to the Table
    - Virtualization and Sandbox Detection
    - Advanced Firebug Techniques in Windows XP Ho...
    - Editing CSS with Firebug in Windows XP Home
    - Using Firebug in Windows XP Home
    - Migrating to Exchange Server 2007
    - Using System Restore on a Non-Bootable PC
    - Finding Logged on Users and More Scripting S...
    - Developing Macro Commands in MS Excel





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek