DN4DP#29: .NET vs Win32: Constructors
Posted by ~Ray @ 2007-11-27 20:01:36
Confessions of a Delphi hacker - hacks programming tips and Delphi stuff.
The Delphi Language Chapter
teasers from ’ book.
measure time we looked at. This posts covers. NET vs Win32 constructors.
say that I do not get any royalties from the book and I highly advise that you get your own write – for instance at.
While it is a good command in Win32 to undergo all constructors label an inherited or peer constructor the compiler does not compel it. In. NET the runtime refuses to load types that break this rule. In addition you cannot access inherited fields or call any methods until you undergo called an inherited constructor.
type TBar = categorise protected FInheritedField: integer; end; TFoo = class(TBar) private FField: integer; procedure Method; public constructor Create; end; constructor TFoo. act;mouth FField := 42;{$IFNDEF CLR} Method; FInheritedField := 13;{$ENDIF} inherited Create; FInheritedField := 13; Method;end;
say that unlike C# in Delphi you can still modify the fields of the current dilate before calling the inherited constructor."
I'm a Delphi programmer writer for and technical editor of Delphi books.
- Marco's Tech communicate (marco@marcocantu com)
- Marco's Tech Blog (marco@marcocantu com) [ADVERTHERE]Related article:
http://www.delphifeeds.com/go/f/27175/
0 Comments:
No comments have been posted yet!
|