[fpc-pascal] Re: Identifier not found "result"
RainerStratmann at t-online.de
Thu Aug 30 17:14:17 CEST 2012
Am Thursday 30 August 2012 16:50:30 schrieb Tomas Hajny:
> > The scenario occures when someone starts freepascal as I already
> > documented in
> > my first E-Mail.
> > 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.
> Identifier Result was not known/supported as function result in TP/BP,
> i.e. your statement applies to Delphi only. Still, people with Delphi
> background are obviously more likely to come across FPC nowadays, but
> these people usually need $MODE DELPHI anyway due to many other things
> they are used to and I miss to see how this one particular case improves
> the overall situation for them. On the other hand, pointing out all
> differences among the different modes by similar compiler messages is
> fairly likely to require considerable effort.
It is not about pointing out all differences.
It is _simply_ that what I guess occures often when a beginner starts with
freepascal. The realization of this message is easy I think. TP for DOS at
least supports a function result (as I remember) thus it is not Delphi only
as you mention. Even if it is Delphi only the programmer who switched to
freepascal sees the message 'identifier "result" not found' and is forced to
study the documentation (which he already has to do much when starting with
setting up the whole fpc environment). I have this thought that freepascal is
not mature when I saw this the first time. And if there is a _simple_ message
like described in other mails then the most obscurities are eliminated. In
TP/BP there was not a syntax mode as far as I remember (or preconfigured
one). The IDE worked out of the box!
What's wrong with such a message that is easy to implement and will help
beginners to freepascal a lot?
More information about the fpc-pascal