October 31, 2025, 07:39:23 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


I never could decide this one!

Started by Brian, December 23, 2010, 07:58:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

Hi,

Can someone tell me if we really need to have a RETURN with an ENDSUB
if the RETURN isn't actually returning a value?

I have read the help file, and I still can't decide!

Brian

LarryMc

no you don't need it if you're not returning anything.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

Thanks, Larry,

I suspected that was the case, but the help file is a bit ambiguous. Help file says:

"The return value is optional only if your subroutine wasn't declared as having one"

It's the "return value" bit that threw me, rather than just saying "return"

Brian


LarryMc

It seems like that there was a time when just a plain return was required and then the requirement was removed.

But, the way my memory is working right now I may have dreamed that. ;)

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

I seem to remember the question being asked before in the forums.  It was asked due to the compiler complaining about not having a RETURN in a SUB.  The answer, if I remember right was that the compiler would put one in for you and complain about it.

Bill
When all else fails, get a bigger hammer.