May 03, 2024, 03:18:52 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


methods need RETURN

Started by Bruce Peaslee, December 27, 2005, 05:12:47 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Bruce Peaslee

I don't think I've seen it here, but a warning: forgetting to put a return in your overridden method can cause the program to crash (i.e., just disappear).
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Parker

Yes, it's the same as IBasic where a closing brace (ENDSUB) doesn't automatically return, which I think it does in C when a function returns "void" (nothing).

Ionic Wind Support Team

The compiler does give a warning that you've forgotten it.  A method is a subroutine.
Ionic Wind Support Team

Bruce Peaslee

Quote from: Ionic Wizard on December 27, 2005, 08:44:05 PM
The compiler does give a warning that you've forgotten it.ÂÃ,  A method is a subroutine.
It does. My point is that you should heed it.ÂÃ,  ;)
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Ionic Wind Support Team

I have changed the parser so it will automatically add the return for functions that don't return a value.  Much like C++ does.

Ionic Wind Support Team

Parker

Yes! No need to put "return;" at the end anymore! Just something that bugged me I guess...

Zen

Hey thats cool. Never thought that would be an optional thing to put if your not returning anything.

Lewis