Results 1 to 3 of 3

Thread: Skip a part of code

  1. #1
    DaoK
    Guest

    Skip a part of code

    1-I want to do something than if something = something than exit the function who I am.

    2-I want to know what is the Exit Do in vb in C++ please


    For the #1 question this is a screenshot who will show you what I want to do:
    Where the arrow start I want something than will jump all the code to the end of that function.

    Attached Images Attached Images  

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    1 - using the return statement will exit a function. If the function needs to return a value, you'll need to return it.

    2 - the break statement will get you out of any loop.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    But remeber that there is no break nesting.
    If you have two loops, you can't use break to quit the outer. Also, since switch statements use break too, you can't get out of the do...while loop from within the switch block.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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