METHOD

From Recital Documentation Wiki
Revision as of 10:48, 17 March 2009 by Yvonnemilne (Talk | contribs)

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

METHOD

Class

Applications


Purpose

External method definition for a class


Syntax

METHOD <class-name> :: <method-name>


See Also

CLASS, PARAMETER, RETURN


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 methodsmethod display external
// Define internal methods
method update
....
return
endclass
 
// External method for 'myclass' classmethod myclass::display
parameter whatever
...
return


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer