[Lazarus] Where to set project search paths in lazarus?
Bo Berglund
bo.berglund at gmail.com
Thu Sep 30 17:26:22 CEST 2010
On Thu, Sep 30, 2010 at 9:54 AM, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:
> On 29/09/2010, Bo Berglund <bo.berglund at gmail.com> wrote:
>>
>> property Xmin: double read GetXmin;
>> function Scale(Xmin, Xmax, Ymin, Ymax: Double; bSame: boolean): boolean;
>>
>> I get an error because of a duplicate identifier on the function
>> line because the property is named the same as the argument to
>> the function! This makes no sense at all to me. Why would this
>> be an error??? This unit compiles fine in Delphi7.
>>
>> What is going on?
>
>
> You are using compiler mode {$mode objfpc} instead of {$mode delphi}.
> The first one (normally the default for FPC projects is more strict
> with object pascal syntax. The latter one is more geared to Delphi
> behaviour. Just to get your project to compile with minimal fuss,
> change to delphi compiler mode. In the long run, I would recommend you
> fix your code and use objfpc mode.
All right, when was it forbidden to have a method that has parameter Xmax
and another method that also has the parameter name Xmax?
Because this is precisely what FPC complains about.
It also marks other parameter names like GetXmax probably because they
*contain* the string Xmax in their otherwise longer names...
I simply do not understand why this would be illegal...
But using the Lazarus function to convert the unit from Delphi made it stop
complaining... And this while leaving my parameter names as is.
Still I don't see the reason for it to begin with.
> NOTE:
> Compiler modes are set per unit. The default (if the unit doesn't
> contain {$mode ...} line can be set via a compiler parameter. Read the
> FPC compiler help for more details.
>
Still think that it should not be needed for simple units, maybe for forms
and more complex stuff...
--
Bo B
More information about the Lazarus
mailing list