[fpc-pascal] Re: Identifier not found "result"

Rainer Stratmann RainerStratmann at t-online.de
Thu Aug 30 15:41:30 CEST 2012

Am Thursday 30 August 2012 15:20:46 schrieb Mark Morgan Lloyd:
> > When someone wants to compile a TurboPascal or Delphi program with
> > freepascal. Then he already knows that result is a function result, but
> > freepascal gives an error about this.
> I agree. However I don't know whether a blanket "you're in the wrong
> mode, lackwit!" error message would be a solution, since it's possible
> to envisage cases where result is an ordinary variable and should be
> referenced as such- irrespective of mode.
> procedure xxx(var result2: yyy);
> begin
>    result := zzz

For people who switch from Delphi or TurboPascal to Freepascal this scenario 
is very unlikely because the source already compiles errorfree (I hope so).

Also if starting with freepascal your scenario is unlikely (not that I don't 
see what you want to say).

The message could be a question: "are you in the right syntax-mode?"
This is better than leave the beginner alone with reading the docs.

This message is even more a better help for beginners: "are you in the right 
syntax-mode? only ObjFPC (-MObjfpc) or Delphi (-Mdelphi) mode supports a 
function result"

More information about the fpc-pascal mailing list