[fpc-pascal] Return Statement

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Apr 10 19:06:54 CEST 2009


On Fri, 10 Apr 2009 12:57:20 -0400
Richard Ward <roward at mac.com> wrote:

> My last post got me thinking about weaning myself from macpas
> mode. One of the statements I have found quite useful is the macpas
> defined "return" statement which is used to return the function value
> and exits immediately from inside any nested block.   Has there been
> any thought or discussion about incorporating "return" into the main  
> language?  For me, it simplifies writing functions considerably and  
> makes the code easier to read/understand - even if it just replaces
> a simple function assignment statement at the end of the function.  -
> R
> 
> This
>    ...
>    return x;
> end;
> 
> vs this
>    ...
>    funcname := x;
> end;

exit(x); can be used in mode objfpc.


Mattias



More information about the fpc-pascal mailing list