"Disappearing" return value !?!?

M

Mac

Hello,
I've a function defined like this:

Public Function DegsToRads(ByVal degrees As Single) As Single
DegreesToRadians = degrees / 57.29578
End Function

and use it like this:
angleDeg = RadsToDegs(angle)

both angle and angleDeg defined as Single; but all Iget is a 0 ..even when
in debug mode I can see that inside DegsToRads the value gets meaningful,
upon exit from DegsToRads I get zero again..it drives me nuts! What might be
wrong here?
 
P

Paul Herber

Hello,
I've a function defined like this:

Public Function DegsToRads(ByVal degrees As Single) As Single
DegreesToRadians = degrees / 57.29578
End Function

and use it like this:
angleDeg = RadsToDegs(angle)

both angle and angleDeg defined as Single; but all Iget is a 0 ..even when
in debug mode I can see that inside DegsToRads the value gets meaningful,
upon exit from DegsToRads I get zero again..it drives me nuts! What might be
wrong here?

The function is named DegsToRads and the return value is (not) being
set in DegreesToRadians.
 
M

Mac

:-D Ah...well, my excuse is that I am not a VBA programmer and something like
this would not be possible in other environments without strong resistance of
the compiler.:) Thank you!
 
P

Paul Herber

:-D Ah...well, my excuse is that I am not a VBA programmer and something like
this would not be possible in other environments without strong resistance of
the compiler.:) Thank you!

I agree 100%
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top