Wish I still long for Do Loop While()

Discussion in 'B4J Bugs & Wishlist' started by Didier9, Jun 6, 2019.

  1. Didier9

    Didier9 Active Member Licensed User

    Is there any plan to add the common Visual Basic form of the Do Loop:
    ' do stuff
    Loop While( some_test )
    I really miss it at times, it would clean up some of my code.
    Thank you in advance...
  2. XbNnX_507

    XbNnX_507 Active Member Licensed User

    Do While some_test
    ' do stuff
  3. Didier9

    Didier9 Active Member Licensed User

    Almost the same thing but not quite, which was the point of my request.
  4. Didier9

    Didier9 Active Member Licensed User

    In the first form, do_stuff is executed at least once even if the condition is false.
    In the second form, the do_stuff code is not executed at all if the condition is false.
    Turns out I tend to use the second form more.
  5. RandomCoder

    RandomCoder Well-Known Member Licensed User

    You can still achieve the same thing with a DO WHILE....
    Do While (some_test AND firstloop)
    ' do stuff
  6. MarkusR

    MarkusR Well-Known Member Licensed User

    Sub Test
    Dim a As Int =0
    Do While 1=1
    If a = 0 Then Exit

    End Sub
    favorite syntax wish

    If x Then Exit Do
  7. Didier9

    Didier9 Active Member Licensed User

    Of course I can do that but it's not what I would call elegant.
    Reason for the rant is I am just done converting a fairly large piece of VB 6.0 code that had a lot of these and I was not too happy about having to deal with that.

    On the other hand, B4J is just so much nicer in so many other aspects that I am still way ahead. The new code is probably half the size and twice as maintainable.
    Nevertheless, I shall complain...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice