IonicWind Software

IWBasic => General Questions => Topic started by: Brian on December 23, 2010, 07:58:30 AM

Title: I never could decide this one!
Post by: Brian on December 23, 2010, 07:58:30 AM
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
Title: Re: I never could decide this one!
Post by: LarryMc on December 23, 2010, 08:03:17 AM
no you don't need it if you're not returning anything.

LarryMc
Title: Re: I never could decide this one!
Post by: Brian on December 23, 2010, 08:49:55 AM
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

Title: Re: I never could decide this one!
Post by: LarryMc on December 23, 2010, 09:26:49 AM
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
Title: Re: I never could decide this one!
Post by: billhsln on December 23, 2010, 09:30:19 AM
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