I have a library of functions contained in a delphi unit which we shall call UtilitiesU. Some of these functions are just helper functions that are only used inside UtilitiesU. I would like to limit the scope of these functions to UtilitiesU. These are the methods that I know of for doing this:
Ideally, I would like to do it the C/C++ way - that is, declare them as static in the implementation section. Is this possible? Is there a better way?
You can still declare your functions like this:
implementation
procedure ShowMe;forward;
procedure TForm1.FormCreate(Sender: TObject);
begin
ShowMe;
end;
procedure showMe;
begin
ShowMessage('Hello');
end;
So you can put all your function right after the implementation in the order you want. Declare them forward, and define them further down anywhere you want.
Personnally, I kindda prefer declaring those method as class methods. (Lets call it, "name space friendly"). But end result is pretty much the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With