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

COMMON makes the variables or block of 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, as then you don't need to share them seperately in the module.