• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Executing VBScript Loopsy

If you want to repeat an action more than one time, VBScript provides a variety of constructs for doing so. The first, called a For...Next loop, executes a set of statements some number of times. You specify three expressions: an initial expression, which sets the values of any variables you need to use; a final value, which tells the loop how to see when it is done; and an increment expression, which modifies any variables that need it. The following is a simple example:

for count = 0 to 100 step 2
    document.write("Count is " & CStr(count) & "<BR>")
next


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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