Difference between revisions of "METHOD"
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
External method definition for a class | External method definition for a class | ||
Line 16: | Line 9: | ||
==See Also== | ==See Also== | ||
− | [[CLASS]], [[ | + | [[ACLASS()]], [[ADDPROPERTY()]], [[AMEMBERS()]], [[CLASS]], [[CLASS - Methods]], [[CLASS - Parameters]], [[CLASS - Properties]], [[CLASS - Scoping]], [[COMPOBJ()]], [[CREATEOBJECT()]], [[DEFINE CLASS]], [[DISPLAY CLASSES]], [[DODEFAULT()]], [[FOREACH]], [[LIST CLASSES]], [[LOADOBJECT()]], [[NEWOBJECT()]], [[OBJECT()]], [[PRINT_HTML()]], [[PRINT_JSON()]], [[PRINT_R()]], [[PRINT_XML()]], [[REMOVEPROPERTY()]], [[REQUIRE_ONCE()]], [[SAVEOBJECT()]], [[SQL SELECT]], [[WITH]] |
Line 38: | Line 31: | ||
<code lang="recital"> | <code lang="recital"> | ||
class myclass | class myclass | ||
− | // Define properties | + | // Define properties |
− | property color as character | + | property color as character |
− | property size as numeric | + | property size as numeric |
− | // Define external methods | + | |
− | method display external | + | // Define external methods |
− | // Define internal methods | + | method display external |
− | method update | + | |
− | .... | + | // Define internal methods |
− | return | + | method update |
+ | .... | ||
+ | return | ||
endclass | endclass | ||
// External method for 'myclass' class | // External method for 'myclass' class | ||
method myclass::display | method myclass::display | ||
− | + | parameters whatever | |
− | ... | + | ... |
return | return | ||
</code> | </code> | ||
− | |||
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
+ | [[Category:Applications]] | ||
+ | [[Category:Applications Commands]] | ||
+ | [[Category:Objects]] | ||
+ | [[Category:Objects Commands]] |
Latest revision as of 15:07, 14 December 2009
Purpose
External method definition for a class
Syntax
METHOD <class-name> :: <method-name>
See Also
ACLASS(), ADDPROPERTY(), AMEMBERS(), CLASS, CLASS - Methods, CLASS - Parameters, CLASS - Properties, CLASS - Scoping, COMPOBJ(), CREATEOBJECT(), DEFINE CLASS, DISPLAY CLASSES, DODEFAULT(), FOREACH, LIST CLASSES, LOADOBJECT(), NEWOBJECT(), OBJECT(), PRINT_HTML(), PRINT_JSON(), PRINT_R(), PRINT_XML(), REMOVEPROPERTY(), REQUIRE_ONCE(), SAVEOBJECT(), SQL SELECT, WITH
Description
An object encapsulates methods that perform operations on the object. Encapsulation hides methods within an object, and makes the object into a fully self-contained operational unit. The METHOD command allows you to define an external method outside the CLASS...ENDCLASS construct. This allows for a procedural library of methods, or for each method to be stored in a separate physical file. An external method can have a parameter list defined with the PARAMETER command. The RETURN command should be used to define the end of the external method.
Keyword | Description |
---|---|
<class-name> | The <class-name> to which the method belongs. |
:: | The :: operator is used as a separator between the class name and method name. |
<method-name> | A unique <method-name> of up to 32 characters must be specified. This will be the name used in the METHOD clause in the CLASS...ENDCLASS construct. |
Example
class myclass // Define properties property color as character property size as numeric // Define external methods method display external // Define internal methods method update .... return endclass // External method for 'myclass' class method myclass::display parameters whatever ... return
Products
Recital Server, Recital