From QB64 Wiki
Revision as of 02:50, 11 December 2009 by imported>Cyperium
Jump to navigation Jump to search

COMMON makes the variables available to a different module.

Syntax: COMMON [SHARED] [/blockname/] variablelist

SHARED makes the variables shared within the subs and functions within that module.

/blockname/ gives the ability to name a block of variables (ex. COMMON /thename/ a, b, c), this name can later be referenced in the module to only give access to those variables. As such many COMMON statements can be issued with different names to be shared in different modules.

variablelist is the variables that should be made available separated by commas.

Remember to keep the variable order the same in both modules as it is the order that matters and not the variables names.

COMMON must be called before any executable statements.

COMMON SHARED is most commonly used (hence you almost always see them together in code), as then you don't need to share the variables seperately in the module for use in subs and functions of that module.



Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage