Difference between revisions of "Unit"

From Free Pascal wiki
Jump to navigationJump to search
m
Line 1: Line 1:
A '''unit''' is a [[source code]] file (or the [[binary]] compiled from that [[file]]) which was written using the [[Pascal]] programming language, and that is designed to be a single module in an [[application]] or an [[object module]].   
+
A '''unit''' is a [[Source code|source code]] file (or the [[Binary|binary]] compiled from that [[File|file]]) which was written using the [[Pascal]] programming language, and that is designed to be a single module in an [[Application|application]] or an [[Object module|object module]].   
  
 
A unit may be used where certain functionality is to be provided to an application program or to other units, and allowing code that performs that functionality to be created once and used in many places.  This can reduce the possibility of error and increase the possibility of code reuse.
 
A unit may be used where certain functionality is to be provided to an application program or to other units, and allowing code that performs that functionality to be created once and used in many places.  This can reduce the possibility of error and increase the possibility of code reuse.
Line 5: Line 5:
 
A unit may be used where a program author wishes to provide certain functionality for use in a Pascal program but does not wish to provide the source code that performs that functionality.
 
A unit may be used where a program author wishes to provide certain functionality for use in a Pascal program but does not wish to provide the source code that performs that functionality.
  
Units were also used on older versions of Pascal when it was nececessary on computers with limited resources to be able to load routines as needed rather than keeping every routine of the [[executable program]] in memory all of the time.
+
Units were also used on older versions of Pascal when it was nececessary on computers with limited resources to be able to load routines as needed rather than keeping every routine of the [[Executable program|executable program]] in memory all of the time.
  
 
A unit may also be used to declare a series of global constants or variables for use by the entire application, without actually containing any executable code.
 
A unit may also be used to declare a series of global constants or variables for use by the entire application, without actually containing any executable code.
 
{{Stub}}
 

Revision as of 16:54, 10 January 2007

A unit is a source code file (or the binary compiled from that file) which was written using the Pascal programming language, and that is designed to be a single module in an application or an object module.

A unit may be used where certain functionality is to be provided to an application program or to other units, and allowing code that performs that functionality to be created once and used in many places. This can reduce the possibility of error and increase the possibility of code reuse.

A unit may be used where a program author wishes to provide certain functionality for use in a Pascal program but does not wish to provide the source code that performs that functionality.

Units were also used on older versions of Pascal when it was nececessary on computers with limited resources to be able to load routines as needed rather than keeping every routine of the executable program in memory all of the time.

A unit may also be used to declare a series of global constants or variables for use by the entire application, without actually containing any executable code.