CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 1998
    Posts
    16

    Urgent: Returning values from a function



    I am not familiar with VB. As I understand, in c++ at the point of the execution of a return statement within a function, the program exits the function returning that value even if there is more code that can be executed. Is this true in VB

  2. #2
    Join Date
    Apr 1999
    Location
    Rotterdam, Netherlands
    Posts
    278

    Re: Urgent: Returning values from a function



    Hi

    Indeed, the C/C++ statement return returns a value and quit the function you're currently in.

    In VB, there's nothing compared with that.

    Although, there's something close to that......

    Exit Function (or Exit Sub)

    As soon as you run to this line, the function will end no matter what code is after that.

    To return a value from a function, use the functionname as a variable...... MyFunc = ret_val


    Hope this helps


    Crazy D

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

Featured