Results 1 to 4 of 4

Thread: do while ...loop

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Question

    Hi


    How I continue a loop as:


    Do while <cond a>

    if <cond b> then
    var_date = dateadd("d",7,var_date)
    < here I wante go back for loop without staments down>

    <staments>
    end if
    loop

  2. #2
    Addicted Member Dim A's Avatar
    Join Date
    Jul 2000
    Posts
    201

    I think...

    I think, you want to do something like this?

    Code:
    Do While <cond a> 
    
    If <cond b> then 
       var_date = dateadd("d",7,var_date) 
       <here I want loop back, without the statements down> 
    Else
       <statements> 
    End If 
    Loop
    Let me know if I'm right.

    (stupid code tags, getting inverted and making me edit my posts)

    [Edited by Dim A on 08-01-2000 at 03:15 PM]

  3. #3
    Addicted Member Dim A's Avatar
    Join Date
    Jul 2000
    Posts
    201

    Re: I think...

    Originally posted by Dim A
    I think, you want to do something like this?

    Code:
    Do While <cond a> 
    
    If <cond b> then 
       var_date = dateadd("d",7,var_date) 
       <here I want loop back, without the statements down> 
    Else
       <statements> 
    End If 
    Loop
    Let me know if I'm right.
    Or did you mean something more like this?

    Code:
    Do While <cond a> 
    
       If <cond b> then 
          var_date = dateadd("d",7,var_date) 
          <here I want loop back, without the statements down> 
       End If 
    Loop
    
    If <cond b> then 
       <statements> 
    End If

  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Ugly but effective:

    Do while <cond a>

    if <cond b> then
    var_date = dateadd("d",7,var_date)
    go to Loop_Exit

    <staments>
    end if

    Loop_Exit:
    loop

Posting Permissions

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



Click Here to Expand Forum to Full Width