V
Victor Hannak
I have a class with the following public function:
float FuncClass::GetResult() {
try {
return(Result);
} catch (...) {
WriteString("FuncClass::GetResult ERROR: Exception encountered");
return(0);
}
}
Result is a private variable of type float. I am repeatedly seeing the
catch portion being executed from the above code, and my Borland debugger is
telling me that it is an EOverflow exception.
How is it possible that such an exception is triggered by a return
statement. It would seem logical that if an overflow situation occurrs, it
would happen when I am assigning (an addition) to the Result variable, but
not when I am returning the Result variable. How is this possible?
float FuncClass::GetResult() {
try {
return(Result);
} catch (...) {
WriteString("FuncClass::GetResult ERROR: Exception encountered");
return(0);
}
}
Result is a private variable of type float. I am repeatedly seeing the
catch portion being executed from the above code, and my Borland debugger is
telling me that it is an EOverflow exception.
How is it possible that such an exception is triggered by a return
statement. It would seem logical that if an overflow situation occurrs, it
would happen when I am assigning (an addition) to the Result variable, but
not when I am returning the Result variable. How is this possible?