On Tue, 07 Jul 2009, Szak�ts Viktor wrote:

Hi,

> To me current large DO CASE statement seems equivalent to
> this single function call:
> ::pPtr := hb_ExecFromArray( @qt_*(), hb_AParam() )
> It will pass through the number of parameters received.

Both method are two complicated. ... can be used as argument in Harbour
in function parameters, array elements and in array indexes so the above
code can be reduced two:

   METHOD New( ... ) CLASS QBrush
      ::pPtr := Qt_QBrush( ... )
      RETURN Self

No need for CASE ... / SWITCH statements or intermediate calls with
hb_ExecFromArray().
Please make some test. It's very powerful mechanism, i.e. instead of
   aP := hb_aPrama()
you can use:
   aP := { ... }
Plase also note that you can use ... more then once and ,mix with other
arguments, f.e.:

   FUNC F1( V1, V2, ... )
   F( { V1, V2 }, "P1", ..., "->", { ..., ..., {...} }, ... )

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

Reply via email to