Re: [fpc-pascal] Variable visibility problem

2006-07-12 Thread Alexandre Leclerc
2006/7/12, Michael Van Canneyt <[EMAIL PROTECTED]>: 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 i

Re: [fpc-pascal] Variable visibility problem

2006-07-12 Thread Michael Van Canneyt
On Wed, 12 Jul 2006, Alexandre Leclerc wrote: 2006/7/12, Michael Van Canneyt <[EMAIL PROTECTED]>: This is not a bug. Your code will compile in DELPHI mode, but not in FPC mode. Ok, I do not want Delphi mode (I try never using this mode: I code in FPC isn't it?). But as a side question, is t

Re: [fpc-pascal] Variable visibility problem

2006-07-12 Thread Alexandre Leclerc
2006/7/12, Michael Van Canneyt <[EMAIL PROTECTED]>: This is not a bug. Your code will compile in DELPHI mode, but not in FPC mode. Ok, I do not want Delphi mode (I try never using this mode: I code in FPC isn't it?). But as a side question, is there a reason we can't do that in FPC? I should re

Re: [fpc-pascal] Variable visibility problem

2006-07-12 Thread Michael Van Canneyt
On Wed, 12 Jul 2006, Alexandre Leclerc wrote: Hi all, in Controls.pas there is TControl.SetName(). In a form I made a procedure with TMyForm.MyProcedure; var setName: string; begin //... end; The compiler complains about: frmMyForm.pas(467,3) Error: Duplicate identifier "SetName" It shou

[fpc-pascal] Variable visibility problem

2006-07-12 Thread Alexandre Leclerc
Hi all, in Controls.pas there is TControl.SetName(). In a form I made a procedure with TMyForm.MyProcedure; var setName: string; begin //... end; The compiler complains about: frmMyForm.pas(467,3) Error: Duplicate identifier "SetName" It should do no problems. But If I want to use SetName of