Results 1 to 3 of 3

Thread: Too many loops

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    4

    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?

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    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.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    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.

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