Better error message suggestion

View: New views
2 Messages — Rating Filter:   Alert me  

Better error message suggestion

by Ron Klinkien :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

If you return a value within a subroutine where you forgot to specify
the return value type for, you get the following error:

"Cannot return a value in a procedure.."
--
PUBLIC SUB GetDeviceType()

  ...
  RETURN something
 
END
--

It's maybe more clear to give something like "Return type not specified
for subroutine at line 123 ...

My 2ct

Regards,
Ron

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gambas-devel mailing list
Gambas-devel@...
https://lists.sourceforge.net/lists/listinfo/gambas-devel

Re: Better error message suggestion

by Benoit Minisini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On vendredi 20 juin 2008, Ron wrote:

> Hi,
>
> If you return a value within a subroutine where you forgot to specify
> the return value type for, you get the following error:
>
> "Cannot return a value in a procedure.."
> --
> PUBLIC SUB GetDeviceType()
>
>   ...
>   RETURN something
>
> END
> --
>
> It's maybe more clear to give something like "Return type not specified
> for subroutine at line 123 ...
>
> My 2ct
>
> Regards,
> Ron
>

Done in revision #1430.

But it won't tell you the line number of the function declaration.

Regards,

--
Benoit Minisini

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gambas-devel mailing list
Gambas-devel@...
https://lists.sourceforge.net/lists/listinfo/gambas-devel