Calling an Object Method
Username:  
Password:
  > Home
> User Guide
v Reference
    > Introduction
    > CROFT
    > BEE Variables
    > BEE Syntax
    > BEE Commands
    > Database Operation
    > Content Management
    v Objects and Classes
       o Classes
       v Objects
          o The Constructor
          o Calling an Object Method
          o Polymorphism
          o Inheritance
          o Object within Object
    > Interface with others
    o Glossary
> Portal Object
> Development Guide


Shortcuts
sys Class
debug Class
Intrinsic Conversions
>> Reference >> Objects and Classes >> Objects >> Calling an Object Method <=  =>      <  1  >  
Calling a function of an object

BEE Script:      ObjName%funcname [name=value ...];

 

BEE Tag:      <beeObjName%funcname [name=value ...]>

 

When calling a function in the above format, it will first find the function funcname from the object ObjName.  The object's function needs to be set in the constructor using var this%function:funcnam = "actual_function_name";, where the actual_function_name is a name defined with the "function" command.

If the function name of the object is not set, the actual function of the same name will be called.

There are three extra arguments that can be accessed within the function: arg%function:this, which evaluates to ObjName, arg%function:thisfunction, which evaluates to funcname, and arg%function:function, which evaluates to actual_function_name.

For example, if the object "myobj" gets var this%function:mymethod = 'myfunc'; and the method is invoked with myobj%mymethod a=1 b=2; then:

arg%function:a

1

arg%function:b

2

arg%function:this

myobj

arg%function:thisfunction

mymethod

arg%function:function

myfunc

arg%a

1

arg%b

2

arg%this

myobj

arg%thisfunction

mymethod

 

Note: ObjName can contain BEE Variables.  However, the current version of the parser handle BEE Variable as ObjName only if there is no space, ">" or "]" in the variable syntax.  e.g. {v}%func; is OK, but {v|replace: ,x}%func is not because of the space in the conversion argument.  Also, funcname cannot contain an "%" in its syntax.

 

 

Previous Page       Next Page

Accsoft Computer Technology Pty Ltd     ABN: 98 065 617 549
PO Box 892, Epping NSW 1710         Level 1, Epping Office Park, 242 Beecroft Rd, Epping NSW 2121, Australia
Tel: Sydney - (02)98691668     National - 1300-881668         Fax: (02)98691866
© Copyright 2003 Accsoft Computer Technology Pty Ltd