www.webdeveloper.com
Results 1 to 3 of 3

Thread: For Loops

  1. #1
    Join Date
    Nov 2005
    Posts
    109

    Exclamation For Loops

    I have to change javascript for loops to asp for loops. I'll give an example as to what I've been doing.

    [javascript]

    for(var x=0;x<0;x++)

    [asp]
    dim x:x=0
    for x<0
    //some code//
    x++
    next

    The only problem is that I realized that I've been forgetting to put the to at the end of statement. My question is, what do I put after the to if my original loop is all used up?

    Any help would be appreciated.

  2. #2
    Join Date
    Jun 2004
    Location
    Kansas City, MO
    Posts
    1,607
    Code:
    For i = 1 to 10 
       if i = 5 then 
           Exit For
       End if 
    Next
    
    Do while i < 10 
      if i = 5 then 
          Exit Do
      End if 
       i = i + 1
    Loop

  3. #3
    Ubik's Avatar
    Ubik is offline &lt;%= &quot;New Meja Hor&quot; %&gt;
    Join Date
    Nov 2005
    Location
    Earth
    Posts
    361
    PHP Code:
    <%
    Dim intLoopThing
    Dim intMin
    Dim intMax
    FOR intLoopThingintMin TO intMax
         response
    .write ("Count: " intLoopThing"<br />")
    NEXT
    %> 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles