CBFalconer wrote:
Markus Gerwinski wrote:
Program Test;
var x: integer;
Function foo: integer;
Procedure bar; begin (* bar *) result:= 7; end (* bar *);
begin (* foo *) bar; end (* foo *);
begin x:= foo; end.
yields an error message
test.pas: In procedure `bar': test.pas:14: error: invalid access to `Result' test.pas: In function `foo': test.pas:20: error: result of function not assigned
Bug or feature?
Feature. The program is flat out wrong
No, it's not. Try compiling
... Function foo: integer;
begin (* foo *) result:= 7; end (* foo *); ...
This works. It is Delphi standard, supported by GPC since 2003. Only if you move `result ' into a local subroutine, you get an error. ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193