[fpc-pascal] Multiple active class helpers at same time

LacaK lacak at zoznam.sk
Mon Apr 23 14:02:13 CEST 2018



Dňa 23.4.2018 o 13:52 Maciej Izak napísal(a):
> 2018-04-23 13:45 GMT+02:00 Maciej Izak <hnb.code at gmail.com 
> <mailto:hnb.code at gmail.com>>:
>
>     https://github.com/maciej-izak/PascalSmartPointers/tree/master/examples
>     <https://github.com/maciej-izak/PascalSmartPointers/tree/master/examples>
>
>
> small mistake, this is more proper url :)
>
> https://github.com/maciej-izak/PascalSmartPointers/tree/master/sources 
> <https://github.com/maciej-izak/PascalSmartPointers/tree/master/sources>
>
> -- 
Thank you.
Can you give small example for my use case ? I can not understand from 
above mentioned examples.

So I need to have:

unit A;
type
   TClassA = class
     public
        procedure Method1;
   end;

unit B;
type
   TClassAHelper1 = class helper for TClassA
     public
       procedure MethodB1;
       procedure MethodB2;
end;

unit C;
type
   TClassAHelper2 = class helper for TClassA
     public
       procedure MethodC1;
       procedure MethodC2;
end;

and in program:

use A,B,C;
var instanceA: TClassA;
...
instanceA := TClassA.Create;
instanceA.Method1;
instanceA.MethodB1; // defined in unit B
instanceA.MethodC1; // defined in unit C
...

L.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180423/9b72f5c1/attachment.html>


More information about the fpc-pascal mailing list