Wants Wrong With my loop Code (Yoda)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yoda
    Contributor
    • Dec 2006
    • 291

    #1

    Wants Wrong With my loop Code (Yoda)

    Private Sub form_Activate
    Loop Until 200
    If 200 Then End
    End Sub
  • Ben3eeE
    New Member
    • Dec 2006
    • 8

    #2
    Code:
    Dim variable As Integer
    Do Until variable = 2
    MsgBox("loop")
    variable = variable + 1
    Loop

    Comment

    • yoda
      Contributor
      • Dec 2006
      • 291

      #3
      Originally posted by Ben3eeE
      Code:
      Dim variable As Integer
      Do Until variable = 2
      MsgBox("loop")
      variable = variable + 1
      Loop
      thanks I ma still in high school so i'm a new to this stuff

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by Ben3eeE
        Code:
        Dim variable As Integer
        Do Until variable = 2
        MsgBox("loop")
        variable = variable + 1
        Loop
        Wouldn't it be simpler to code this as a For loop? For example...
        Code:
        Dim variable As Long
        For variable = 0 To 1
          MsgBox("loop")
        Next

        Comment

        Working...