Polymorphism
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 >> Polymorphism <=  =>      <  1  >  
Polymorphism

Polymorphism in the BEE is implemented with function reference.  Every object class has a "function" variable, of which every element is a definition of a function name.  For example:

var car1%model = "Camry";

var car2%model = "Diablo";

 

var car1%function:whatType = "familyCar";

var car2%function:whatType = "playCar";

 

function familyCar

{

   display "{this%model} is a car for the family.";

}

 

function playCar

{

   display "{this%model} is for fun.";

}

 

car1%whatType;  // Camry is a car for the family.

car2%whatType;  // Diablo is for fun.

 

 

 

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