Re: Inerface and Class reference

Allan Smith <[email protected]> Mon, 18 Aug 2003 11:04:04 +0100
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <[email protected]>
On Mon, 18 Aug 2003 07:25:43 -0000, ohm_prasadam wrote:

>Sir/Madam?
>1. What is meant by Interface? why can't we define COM calsses etc. in 
>a somple Unit?
>
>2. What is class reference? "TTestClass = class of TSampleClass" What 
>is the advantage of declaring like this?
>
>If anybody can answer this please do it. 

2) you can assign the class of any descendant class if TSampleClass to
TTestClass and subsequently use it do create an instance of a class which is a
descendant of that class eg if you define TField_Class as Class of TField then
you can assign any descendant of TField to a TField_Class variable anfd use it
to create an instance of that class at run time and the creating procedure
does not need to know what type of field it is creating.


-- 
Regards,
Allan Smith (Northwood, Middlesex, England)

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/i7folB/TM
---------------------------------------------------------------------~->

Delphi VCL Top Sites!
http://www.sandbrooksoftware.com/TS/TS2/Components.shtml
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/