Click to See Complete Forum and Search --> : Urgent: Returning values from a function


John
January 7th, 1999, 10:46 PM
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

john
January 7th, 1999, 10:46 PM
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

Crazy D
January 8th, 1999, 10:07 AM
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