Wish I still long for Do Loop While()

Didier9

Well-Known Member
Licensed User
Longtime User
Is there any plan to add the common Visual Basic form of the Do Loop:
Code: Copy
Do
    ' do stuff
Loop While( some_test )
I really miss it at times, it would clean up some of my code.
Thank you in advance...
 
Almost the same thing but not quite, which was the point of my request.
 
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.
 
You can still achieve the same thing with a DO WHILE....
Code: Copy
firstloop=False
Do While (some_test AND firstloop)
     ' do stuff
     firstloop=True
Loop
 
Code: Copy
Sub Test
    
    Dim a As Int =0
        
    Do While 1=1
        Log("Hello")
        If a = 0 Then Exit
    Loop

    Log("End")
    
End Sub

favorite syntax wish
Code: Copy
Do

 If x Then Exit Do
Loop
 
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...
 
Back
Top