Forum > General

How to link global unit?

(1/1)

M[a]nny:
Hi guys.

I have my own global unit which contains custom functions and procedures that I use in projects and because it is global unit, I'd like to use it in all my forms. Is there any way how to link it for all forms? Thank you for replies.

bflm:

--- Quote from: M[a]nny on September 20, 2010, 02:30:27 pm ---I have my own global unit which contains custom functions and procedures that I use in projects and because it is global unit, I'd like to use it in all my forms. Is there any way how to link it for all forms? Thank you for replies.

--- End quote ---

Is there anything wrong in using the use clause? If I'm not mistaken it should do exactly what you are asking for. Otherwise I've no idea how the compiler will be able to handle the unit(s) which want to refer entities from your "global unit".

M[a]nny:
Of course, I can add it to uses but it has to be added to all units which use this "global unit". I am asking for way how to link it to whole project by once time.

bflm:

--- Quote from: M[a]nny on September 21, 2010, 07:56:33 am ---Of course, I can add it to uses but it has to be added to all units which use this "global unit". I am asking for way how to link it to all project by once time.

--- End quote ---

The problem is not in the linking stage. While compiling any dependent unit the compiler must know from where the dependencies come from and get the definitions of them to type check and generate the actual code for (method) calls, record fetch/store, etc. Without that step it's not possible to compile the dependent unit and thus there's nothing to link.

Still trying this way to point out why it's not possible to avoid using the use clause in every unit dependent on a "global unit".

Navigation

[0] Message Index

Go to full version