[fpc-pascal] Variable visibility problem

Alexandre Leclerc alexandre.leclerc at gmail.com
Wed Jul 12 16:58:21 CEST 2006


2006/7/12, Michael Van Canneyt <michael at freepascal.org>:
> It's not good practice to have local variables with the same name as a
> public method/property. How will you tell which one is used ?
> (obviously you can find out, but at first glance it will not be clear)

Well, I was always doing Self.SetName in these cases... (as an example
here). Same thing for functions implemented in different units (was
hapening): unit1.ProcedureInUnit and unit2.ProcedureInUnit. So it was
obivious for me since local var always have priority.

I was seeing it exactly as the 'with .. do' block.

But this is ok, I'll work the FPC way. I'm not sure this (FPC) will
change anyway :)

Thank you.

-- 
Alexandre Leclerc



More information about the fpc-pascal mailing list