[Lazarus] Where to set project search paths in lazarus?

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Sep 30 17:33:38 CEST 2010


On 30/09/2010, Bo Berglund wrote:
>
> 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.


No, based on your example code you wrote:

>>   property Xmin: double read GetXmin;
>>   function Scale(Xmin, Xmax, Ymin, Ymax: Double; bSame: boolean): boolean;

The function Scale() has a parameter named XMin, but that same class
also has a property called Xmin. This can lead to lots of confusion
for the developer - which XMin are we now referring too inside the
Scale() method, the parameter, or the property of the class?

This is why fpc's compiler mode 'objfpc' has more strict syntax rules
- it reduces such confusion by simply not allowing them. It's quite
logical I think.


> But using the Lazarus function to convert the unit from Delphi made it stop
> complaining... And this while leaving my parameter names as is.

It because the Lazarus "convert from delphi" function automatically
adds {$mode delphi} in each unit, as part of the conversion. It's more
"delphi compatible" [actually just reduces the amount of issues the
developer will have after a conversion], and syntax is less strict.


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net:8080/fpgui/




More information about the Lazarus mailing list