-
Too many loops
I am coming from C/C++ and I am teaching myself VB. If there is a FAQ posted and I missed it, I apologize.
On to the question - why are there so many loops in VB? You have while, do while/loop, do until/loop, do loop/while, and do/loop until. It seems to me that while and do while/loop are exactly the same and do loop/while is only slightly different, and that do until/loop and do/loop until are redundant too.
Why the need for 5 loop structures that only do 2 things? Do VB programmers commonly use 2 of these and ignore the others for readability or is there some subtlety that I am missing?
-
Re: Too many loops
Hi,
Wait until you have completed a few commercial programmes and you will then appreciate the flexibility. Yes, it is possible to make do with a D0......Loop in every case, but you will need to fill it with value checks which will take more time and effort than using an appropriate Loop.
-
Re: Too many loops
Actually most VB programmers use a For Each loop more than any other kind. But also generally speaking the Do While and Do Until loops are most common.