[fpc-pascal] identifier scope problem

Thierry Coq tcoq at free.fr
Tue May 4 08:12:54 CEST 2010


try prefixing by the unit name:

procedure tcls.method(x,y: tt);
begin
  if a.equals(x,y) then
    ...
end;

Thierry

leledumbo wrote:
> consider the following code snippet:
> <code>
> unit a;
>
> interface
>
> type
>   tt = ...
>   tcls = class
>   procedure method(x,y: tt);
>   end;
>
> function equals(x,y: tt): boolean;
>
> implementation
>
> function equals(x,y: tt): boolean;
> begin
>   ...
> end;
>
> procedure tcls.method(x,y: tt);
> begin
>   if equals(x,y) then
>     ...
> end;
>
> end.
> </code>
>
> In the code above, equals will refer to tobject.equals instead of equals
> defined in the unit. How can I refer to that one instead?
>
>   




More information about the fpc-pascal mailing list