Revision history for ProPgVarProcLinkage


Revision [21686]

Last edited on 2016-11-07 08:21:19 by fxm [Formatting]

No Differences

Revision [21232]

Edited on 2016-03-13 14:32:07 by fxm [Formatting]
Additions:













Revision [20669]

Edited on 2016-02-10 16:13:42 by DkLwikki [Update link format]
Additions:
Variable and object names declared at module-scope have internal linkage unless otherwise declared with ##[[KeyPgExtern|Extern]]## or ##[[KeyPgCommon|Common]]##. For example, variable names first introduced with ##[[KeyPgDim|Dim]]## or ##[[KeyPgStatic|Static]]## have internal linkage, and those variables can only be referred to by name within the module in which they are defined. Note that using ##[[KeyPgShared|Shared]]## only allows name visibility within the module's procedures, and does not contribute to the name's linkage.
Procedure names declared with ##[[KeyPgPrivate|Private]]## have internal linkage.
All variable and object names declared at local-scope (in a ##[[KeyPgDo|Do]]## loop, or procedure body, for instance) have internal linkage.
Variable and object names declared at module-scope are declared to have external linkage with ##[[KeyPgExtern|Extern]]## or ##[[KeyPgCommon|Common]]##.
##[[KeyPgExtern|Extern]]## declares the variable having external linkage, but does not define it. This external declaration must come before any definition of the same name (a declaration without ##[[KeyPgExtern|Extern]]## specifies internal linkage, and currently, any further external declarations of that name signify a duplicated definition). Variable and object names with external linkage declared using ##[[KeyPgExtern|Extern]]## are always in the shared scope, and so can be referred to within procedure bodies.
##[[KeyPgCommon|Common]]## declares the variable having external linkage as well as defining the variable. But, it is different from ##[[KeyPgExtern|Extern]]## in that the ##[[KeyPgCommon|Common]]## definition of the variable may appear in more than one module. When used with arrays, only variable-length arrays without subscripts may be declared, and the array must be sized at run-time using ##[[KeyPgDim|Dim]]## or ##[[KeyPgRedim|ReDim]]## before it can be used. Variable and object names with external linkage declared using ##[[KeyPgCommon|Common]]## are only in the shared scope if the ##[[KeyPgShared|Shared]]## scope specifier is also given. Shared variables can be referred to within procedure bodies.
When both ##[[KeyPgExtern|Extern]]## and ##[[KeyPgCommon|Common]]## are both used to declare and define a variable, the effect is that the meaning of ##[[KeyPgCommon|Common]]## statement is altered to behave as though it were a ##[[KeyPgDim|Dim]]## declaration. So it is generally, not recommended to mix ##[[KeyPgExtern|Extern]]## and ##[[KeyPgCommon|Common]]## on the same variable in the same module. However, variables may be declared and defined with ##[[KeyPgCommon|Common]]## in one module and then referenced with ##[[KeyPgExtern|Extern]]## in another module without confusion.
Procedure names are declared to have external linkage by default. Declarations using ##[[KeyPgPublic|Public]]## explicitly specify external linkage.
Deletions:
Variable and object names declared at module-scope have internal linkage unless otherwise declared with ##[[KeyPgExtern Extern]]## or ##[[KeyPgCommon Common]]##. For example, variable names first introduced with ##[[KeyPgDim Dim]]## or ##[[KeyPgStatic Static]]## have internal linkage, and those variables can only be referred to by name within the module in which they are defined. Note that using ##[[KeyPgShared Shared]]## only allows name visibility within the module's procedures, and does not contribute to the name's linkage.
Procedure names declared with ##[[KeyPgPrivate Private]]## have internal linkage.
All variable and object names declared at local-scope (in a ##[[KeyPgDo Do]]## loop, or procedure body, for instance) have internal linkage.
Variable and object names declared at module-scope are declared to have external linkage with ##[[KeyPgExtern Extern]]## or ##[[KeyPgCommon Common]]##.
##[[KeyPgExtern Extern]]## declares the variable having external linkage, but does not define it. This external declaration must come before any definition of the same name (a declaration without ##[[KeyPgExtern Extern]]## specifies internal linkage, and currently, any further external declarations of that name signify a duplicated definition). Variable and object names with external linkage declared using ##[[KeyPgExtern Extern]]## are always in the shared scope, and so can be referred to within procedure bodies.
##[[KeyPgCommon Common]]## declares the variable having external linkage as well as defining the variable. But, it is different from ##[[KeyPgExtern Extern]]## in that the ##[[KeyPgCommon Common]]## definition of the variable may appear in more than one module. When used with arrays, only variable-length arrays without subscripts may be declared, and the array must be sized at run-time using ##[[KeyPgDim Dim]]## or ##[[KeyPgRedim ReDim]]## before it can be used. Variable and object names with external linkage declared using ##[[KeyPgCommon Common]]## are only in the shared scope if the ##[[KeyPgShared Shared]]## scope specifier is also given. Shared variables can be referred to within procedure bodies.
When both ##[[KeyPgExtern Extern]]## and ##[[KeyPgCommon Common]]## are both used to declare and define a variable, the effect is that the meaning of ##[[KeyPgCommon Common]]## statement is altered to behave as though it were a ##[[KeyPgDim Dim]]## declaration. So it is generally, not recommended to mix ##[[KeyPgExtern Extern]]## and ##[[KeyPgCommon Common]]## on the same variable in the same module. However, variables may be declared and defined with ##[[KeyPgCommon Common]]## in one module and then referenced with ##[[KeyPgExtern Extern]]## in another module without confusion.
Procedure names are declared to have external linkage by default. Declarations using ##[[KeyPgPublic Public]]## explicitly specify external linkage.


Revision [11762]

The oldest known version of this page was created on 2007-11-10 14:07:37 by JeffMarshall [Update link format]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode