FTE Classes example

/************** EXAMPLE CODE *************
///// THE DEFINITIONS
class FooParent : entity
{

// constructor
void() FooParent =
{
dprint(“I am a FOO\n”);
};

virtual void () WhereAmI =
{
dprint(“In FooParent\n”);

};

};

class FooChild: FooParent
{

virtual void ()WhereAmI=
{
dprint(“In FooChild\n”);

};

};

///// SPAWNING:

FooParent e = spawn();
e.WhereAmI();
FooChild e2 = spawn();
e2.WhereAmI();

///// OUTPUT:
I am a FOO
In FooParent
I am a FOO
In FooChild

**************************************************/

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>