Hi, What is the advantages to the compiler return the error bellow? ERROR: unit1.pas(31,3) Error: Duplicate identifier "FooVar"
Why the compiler do not respect the scope, ie, the local variable should have the preference, I'm not right? Not? Why I can use a unit name as a property in my class, so? (see bellow the "StdCtrls" property name). If I use {mode delphi} I can compile... I know. Why not in {mode objfpc} too? See an example code: type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { private declarations } public FooVar: string; StdCtrls: string; end; var Form1: TForm1; implementation {$R *.lfm} procedure TForm1.Button1Click(Sender: TObject); var FooVar: string; begin FooVar := 'foo'; StdCtrls := 'Is that right?'; end; end. Best regards, Marcos Douglas _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel