In Delphi there is a a class TExample defined in file1.pas.
TExample=class
protected
   FValue:longint;
end;

in file2.pas I did:

use file1;
{...}
Example:=TExample.Create;
if Example.FValue=0 then begin...
{...}

When compiling with FPC and $MODE DELPHI I get an "Identifier not
found" error.

Any idea what a tired guy might have missed?

FValue is protected from you.

Mattias

Know that - but why does it work in Delphi? Didn't find a notice about FPC processing "protected" in another way than Delphi does...

Lukas


You must be wrong because this example will not work in delphi (i tried). The only way you can use this mechanisme when the code of file1 is located in file2.

There's a simple trick though:
TExampleFriend=class(TExample); end;
if TExampleFriend(Example).FValue=0 then begin...

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to