• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Loop Structures

As in JavaScript, VBScript has more than one loop structure. The for/next loop is like the for loop in JavaScript, and the do/while loop is equivalent to the do/while loop in JavaScript. The do/until loop is like the do loop in JavaScript.

For/Next Structure

The for/next structure in VBScript expects a beginning and ending value for the loop. With each iteration of the loop, any statements between the for and next statements are executed. The following example shows a simple application using a loop to place formatted values on the screen. Note how the variable spacer is created using a loop as well.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint