[fpc-pascal] Return Statement

Richard Ward roward at mac.com
Fri Apr 10 18:57:20 CEST 2009


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;





More information about the fpc-pascal mailing list