OK next question

Let's say I have a class defined as follows

type Class X = class (TPersistent)
//attributes
...
//operations
procedure Assign (Source: TPersistent); override;

OK I need an Assign procedure so in accordance with what I know about
TPersistent I have to override the inherited Assign operation.

procedure X.Assign(Source: TPersistent);
...

The problem comes when I try to access the properties of Source, which the
compiler says are undeclared. The following have all been tried with various
problems:

procedure X.Assign(Source: X); //declaration differs from inherited

with Source as X do //Still can't access any properties

Source := X(Source); //Still can't access any properties


As of this moment I went back to using a TObject and declaring an Assign
procedure which, since there is no inherited Assign to override, works just
fine.

============================================
Patrick Dunford, Christchurch, NZ
http://patrick.dunford.com/





============================================
Patrick Dunford, Christchurch, NZ
http://patrick.dunford.com/

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to