[fpc-pascal] units order (was using oldlinux )

Michalis Kamburelis michalis at camelot.homedns.org
Tue Jun 14 14:11:57 CEST 2005

Matt Emson wrote:
> 2) use the following trick in your local code:
>   type TMyclashingType = UnitIWantToUse.TMyClashingType;
>   so in your case:
>   type PicHandle = common.PicHandle;
> Solution 1 is more favourable though. Solution 2 will only work if luck is
> on your side and you do not require procedures or functions from both units
> that take the type as a param.

Actually, you can also do this trick with procedures or functions 
(although this time it's really really dirty trick):

Suppose you have MyFunction declared in MyUnit unit. You want to export 
MyFunction in other unit that uses MyUnit:

   MyFunction: function(... MyFunction params...): ...MyFunction 
result... = MyUnit.MyFunction;

More information about the fpc-pascal mailing list