Difference between revisions of "DODEFAULT()"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
Objects
 
 
 
 
==Purpose==
 
==Purpose==
 
Function to call the parent class method from within a sub-class
 
Function to call the parent class method from within a sub-class
Line 12: Line 8:
  
 
==See Also==
 
==See Also==
[[ACLASS()]], [[ADDPROPERTY()]], [[AMEMBERS()]], [[CLASS]], [[COMPOBJ()]], [[CREATEOBJECT()]], [[DEFINE CLASS]], [[METHOD]], [[NEWOBJECT()]], [[REMOVEPROPERTY()]], [[SET CLASSLIBRARY]], [[WITH]]
+
[[ACLASS()]], [[ADDPROPERTY()]], [[AMEMBERS()]], [[CLASS]], [[CLASS - Methods]], [[CLASS - Parameters]], [[CLASS - Properties]], [[CLASS - Scoping]], [[COMPOBJ()]], [[CREATEOBJECT()]], [[DEFINE CLASS]], [[DISPLAY CLASSES]], [[FOREACH]], [[LIST CLASSES]], [[LOADOBJECT()]], [[METHOD]], [[NEWOBJECT()]], [[OBJECT()]], [[PRINT_HTML()]], [[PRINT_JSON()]], [[PRINT_R()]], [[PRINT_XML()]], [[REMOVEPROPERTY()]], [[REQUIRE_ONCE()]], [[SAVEOBJECT()]], [[SQL SELECT]], [[WITH]]
  
  
 
==Description==
 
==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.
+
The 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.
  
  
Line 22: Line 18:
 
<code lang="recital">
 
<code lang="recital">
 
class Box  
 
class Box  
procedure Draw  
+
  procedure Draw  
  messagebox("This is the parent Draw Method")  
+
    messagebox("This is the parent Draw Method")  
endproc && Draw  
+
  endproc && Draw  
 
endclass  
 
endclass  
  
 
class Dialog1 of Box  
 
class Dialog1 of Box  
procedure Draw  
+
  procedure Draw  
  messagebox("This is the object Draw Method")
+
    messagebox("This is the object Draw Method")
// call the Draw method of the Box parent class
+
    // call the Draw method of the Box parent class
  dodefault()  
+
    dodefault()  
endproc && Draw  
+
  endproc && Draw  
 
endclass  
 
endclass  
  
Line 42: Line 38:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:Objects]]
 +
[[Category:Objects Functions]]

Latest revision as of 15:05, 14 December 2009

Purpose

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


Syntax

DODEFAULT()


See Also

ACLASS(), ADDPROPERTY(), AMEMBERS(), CLASS, CLASS - Methods, CLASS - Parameters, CLASS - Properties, CLASS - Scoping, COMPOBJ(), CREATEOBJECT(), DEFINE CLASS, DISPLAY CLASSES, FOREACH, LIST CLASSES, LOADOBJECT(), METHOD, NEWOBJECT(), OBJECT(), PRINT_HTML(), PRINT_JSON(), PRINT_R(), PRINT_XML(), REMOVEPROPERTY(), REQUIRE_ONCE(), SAVEOBJECT(), SQL SELECT, WITH


Description

The 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 Server, Recital