On Fri, 1 Oct 2010, Hans-Peter Diettrich wrote:

Michael Van Canneyt schrieb:

He meant variables that are not part of an object, but declared as a unit
variable. If you put all such 'global' variables in 1 unit, you do drag in all the original units, if the variables are typed.

Every external tool has to drag in all the units, that initialize the used global variables, regardless of their placement in globals.pas or other units. Consequently all global variables should reside in those units, that contain their initialization code. Doing so may increase the number of units, that have to be used in *all* other units, be internal or external, but it would provide the supposed consistency of the unit dependencies - automagically, with no need for further considerations or discussions.

Correct me if I'm wrong, but isn't this exactly the opposite of what you were doing, i.e. putting all such variables in globals.pas ?

Michael.

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to