[fpc-pascal] How to have smaller units

Thomas Kurz fpc.2021 at t-net.ruhr
Sat Nov 29 14:40:33 CET 2025


Can't you use a type helper to access the fields only locally in other classes? Unfortunately this works only for `protected` and not for `private` fields, but if it's your own class, maybe you'd like to give it a try.

Btw: I would be great if type helpers could be given access to `private` fields, too!




----- Original Message ----- 
From: Hairy Pixels via fpc-pascal <fpc-pascal at lists.freepascal.org>
To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
Sent: Saturday, November 29, 2025, 14:31:33
Subject: [fpc-pascal] How to have smaller units

 On Nov 29, 2025 at 6:43:44 PM, Guillermo Martínez Jiménez via fpc-pascal <
fpc-pascal at lists.freepascal.org> wrote:

> I have no idea about what are you doing but I'm pretty sure you can fix
> this by using a different design;  maybe to revise some patterns will
> help you to find the way to do it more properly.


He has a fair point. Imagine you have two classes and they want to write to
their fields but this only happens internally in your library while the
users of the library should never do this. How do you solve it? You
basically want a write property but just internally in your library.



More information about the fpc-pascal mailing list