FOR NEXT LOOP

Results 1 to 3 of 3

Thread: FOR NEXT LOOP

  1. #1
    Join Date
    Dec 1969
    Posts
    38

    Default FOR NEXT LOOP

    Here is the situation:<BR>I have following FOR LOOP<BR>FOR i = 1 to adors.recordcount<BR> if this is true then<BR> do this <BR> adors.movenext<BR> PROBLEM IS HERE <BR> FROM HERE I WANT TO GO UP TO FOR <BR> WITHOUT EXECUTING OTHER IF <BR> AND ALSO INCREMENT i<BR> end if<BR> if this is true then <BR> do this<BR> end if<BR>NEXT<BR><BR>Any thoughts<BR>Thanks <BR>VInay Bansal<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: FOR NEXT LOOP

    Correct me if I am wrong, but it sounds like you want to do this:<BR><BR>For x = 1 to something<BR><BR>if something then<BR>&#039do something<BR>elseif something else<BR>&#039do something else<BR>end if<BR><BR>next<BR><BR><BR>That&#039s all you need to do, use the keyword, elseif.<BR><BR>Happy Programming!<BR>

  3. #3
    vipul desai Guest

    Default RE: FOR NEXT LOOP

    Essentially, you want to use a for Loop where it will increment only when a condition is true. Why not instead use a While Loop <BR><BR>i = i <BR>Do While i &#060; 100 <BR> If condition1 = True then <BR> i = i + 1<BR> rs.movenext<BR> end if <BR>Loop <BR><BR>Another solution would be to use a Goto statement<BR>

Posting Permissions

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