Home > Archive > FoxPro Help and Support > May 2005 > Call a prg within define class to add additional function or proce









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Call a prg within define class to add additional function or proce
Peter

2005-05-13, 3:24 am

I want to know whether it is possible to call a program within define class
to add additional function or procedure:

test.prg contains:

Define class test as custom

procedure x
..
..
endproc

if something is true
do add_procedure in addtoclass.prg
endif


Enddefine

addtoclass.prg contains something like this:

procedure y
..
..
endproc


Olaf Doschke

2005-05-13, 7:24 am

You can only do this with a builder.
A builder may use commands like
oClass.READMETHOD and oClass.WRITEMETHOD.

But a Builder works on a class (oClass) that
isn't instanciated as an object, it works on the
source code of the class.

I think this is especially not possible with prg
classes, but I haven't tried that.

Ehy would wou want that? You can extend
or overload behaviour nicely with BindEvent
or RaiseEvent and another object.

Bye, Olaf.


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com