mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-16 09:44:19 +00:00
aeb9c0668b
Note: Many files were removed (not yet existing/empty pages). The parser will try to download them on demand and will auto-generate text for missing pages (eg. most _gl pages).
28 lines
1.4 KiB
Text
28 lines
1.4 KiB
Text
{{QBDLDATE:05-20-2022}}
|
|
{{QBDLTIME:23:12:23}}
|
|
[[COMMON]] shares common variable values with other linked or [[CHAIN]]ed modules.
|
|
|
|
{{PageSyntax}}
|
|
: [[COMMON]] [SHARED] variableList
|
|
|
|
|
|
{{PageLegacySupport}}
|
|
* The multi-modular technique goes back to when '''QBasic''' and '''QuickBASIC''' had module size constraints. In '''QB64''' the [[COMMON]] statement has been implemented so that that older code can still be compiled, though it is advisable to use single modules for a single project (not counting [[$INCLUDE]] libraries), for ease of sharing and also because the module size constraints no longer exist.
|
|
|
|
|
|
{{PageDescription}}
|
|
* COMMON must be called before any executable statements.
|
|
* [[SHARED]] makes the variables shared within [[SUB]] and [[FUNCTION]] procedures within that module.
|
|
* variableList is the list of common variables made available separated by commas.
|
|
* Remember to keep the variable type ''order'' the same in all modules, as the variables names don't matter.
|
|
* [[COMMON SHARED]] is most commonly used to share the variables with subs and functions of that module.
|
|
* '''Note: Values assigned to shared variables used as procedure call parameters will not be passed to other procedures. The shared variable value must be assigned inside of the [[SUB]] or [[FUNCTION]] procedure to be passed.'''
|
|
|
|
|
|
{{PageSeeAlso}}
|
|
* [[COMMON SHARED]], [[CHAIN]]
|
|
* [[DIM]], [[REDIM]], [[SHARED]]
|
|
* [[DEFSTR]], [[DEFLNG]], [[DEFINT]], [[DEFSNG]], [[DEFDBL]]
|
|
|
|
{{PageNavigation}}
|
|
|