Hi David,
On 04.12.2013 15:22, David Ashley wrote:
> All -
>
> I had a need last night to create a class that could count the number of
> instances that had been created using class methods. I could not find an
> example of this in any of our documentation. Maybe I just did not look
> in the right place but it was not obvious to me if it was there.
>
> Could someone point me to an example of this in our documentation I
> would appreciate it very much. If such an example does not exist then I
> would be happy to add one to our docs once I can locate a good example.
>
> At this point I am just looking for verification that an example
> does/does not exist in our docs.
you would have to add a class method named "new" to your class which counts its 
invocation numbers
(using a class attribute that you initialize in a class INIT method). Please do 
not forget to
forward the invocation to the class INIT and class NEW method to their 
superclasses.

HTH,

---rony

P.S.: Also, you could use metaclasses for that purpose and on demand just use 
the class' directive's
METACLASS subkeyword to point to that class. In that case be aware that a 
specialization of the
class named CLASS is needed and that the "init" and "new" methods there are 
instance methods.

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to