DODEFAULT()

From Recital Documentation Wiki
Revision as of 16:27, 23 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Class

Objects


Purpose

Function to call the parent class method from within a sub-class


Syntax

DODEFAULT()


See Also

ACLASS(), ADDPROPERTY(), AMEMBERS(), CLASS, COMPOBJ(), CREATEOBJECT(), DEFINE CLASS, METHOD, NEWOBJECT(), REMOVEPROPERTY(), SET CLASSLIBRARY, WITH


Description

The Visual FoxPro compatible DODEFAULT() function is used to call the parent class method from within a sub-class. It can only be used within a class method. It calls the parent class method of the same name as the calling method. It allows a sub-class to perform the default parent class behavior along with additional behavior specific to that particular sub-class.


Example

class Box 
procedure Draw 
  messagebox("This is the parent Draw Method") 
endproc && Draw 
endclass 
 
class Dialog1 of Box 
procedure Draw 
  messagebox("This is the object Draw Method")
// call the Draw method of the Box parent class
  dodefault() 
endproc && Draw 
endclass 
 
oDIALOGOK = createobject("Dialog1")
oDIALOGOK.Draw()
release oDIALOGOK


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer