Hi Przemyslaw:
While you are at it...
Would it be possible to implement this in Harbour ?

<quote from docs>
Class

Abstract()

 Syntax

:noMethod( cMessage, [<xValue>,...] ) --> xReturn

Parameters

<cMessage>

The message send to the object.

<xValue>

The parameters passed by the callee to the undefined method.

Return

The return value will be interpreted as the return value of the called undefined method.

Description

If an undefined method is called, a runtime error is raised. However, when :noMethod() is declared in the class, the runtime error will not occur. Instead, program execution is directed to this method. The parameter <cMessage> contains the name of the undefined method, followed by the parameters the callee has passed to the method call.

Example

// noMethod()
// The sample illustrates how :noMethod()
// behaves and does handle passed parameters.
PROCEDURE Main
  LOCAL oH := OHandler():New()

  ? oH:Foo()
  ? oH:FooWithParameter("One","Two",3)

RETURN

// Simple class which redirects any unknown
// method access to the ::NoMethod()
// implementation.
CLASS OHandler
  EXPORTED:
  METHOD NoMethod
ENDCLASS

METHOD OHandler:NoMethod(cMessage,p1,p2)
  LOCAL n
  ? ::ClassName(),"::NoMethod(",cMessage

  FOR n:=2 TO PCount()
    ?? ",",PValue(n)
  NEXT
  ?? " )"
RETURN(PCount())

<end quote>

There is also a :NoIvar for undefined instance variables on objects
It is very usefull to build "virtual dynamic methods and variables on classes". I'm using those ones on xbase++

Best Regards
Angel Pais


[email protected] escribió:
  * harbour/include/hbclass.ch
    + added support for xbase++ compatible method declaration by:
         METHOD <methodName1> [ , <methodNameN> ]

_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to