Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Classes
#3
You can create new classes that inherit member variableas and member functions of existing classes. Let's create a class that inherits from CRect.

Macro
Code:
Copy      Help
class CColorRect :CRect
,m_color

Member function CColorRect.Init
Code:
Copy      Help
function double'width double'height color

this.CRect.Init(width height)
m_color=color

Member function CColorRect.GetColor
Code:
Copy      Help
function#

ret m_color

Example:

Macro
Code:
Copy      Help
CColorRect r3.Init(10 20 0xffff)
out "0x%X" r3.GetColor ;;call function of CColorRect
out r3.Area ;;call function inherited from CRect


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)