Revision history for KeyPgCommon
Revision [25357]
Last edited on 2021-10-05 02:24:58 by fxm [Windows does not support Common with a dynamic library]Additions:
Declares a variable which is shared between code modules, including those to be compiled as static and dynamic libraries (DLLs).
A matching ##**Common**## statement must appear in all other code modules using the variable.
{{fbdoc item="target"}}
- Windows does not support ##**Common**## with a dynamic library (compiled with -dll or -dylib).
A matching ##**Common**## statement must appear in all other code modules using the variable.
{{fbdoc item="target"}}
- Windows does not support ##**Common**## with a dynamic library (compiled with -dll or -dylib).
Deletions:
Additions:
- ##**Common**## does not allow to keep the values of certain variables when chaining programs with ##[[KeyPgChain|Chain]]##.
Additions:
Declares a variable which is shared between code modules, including those to be compiled as static libraries, but not those to be compiled as dynamic libraries (DLLs). A matching ##**Common**## statement must appear in all other code modules using the variable.
Deletions:
Revision [23682]
Edited on 2019-10-04 15:01:38 by fxm ['Common' does not work with dynamic libraries (DLL)]Additions:
Declares a variable which is shared between code modules, including those compiled as static libraries, but not those compiled as dynamic libraries (DLLs). A matching ##**Common**## statement must appear in all other code modules using the variable.
Deletions:
Revision [22686]
Edited on 2019-05-23 01:57:49 by fxm [Added compilation/execution command for the example]Additions:
After compiling the two files like:
##fbc common1.bas common2.bas##
running ##common1## produces the output:
##fbc common1.bas common2.bas##
running ##common1## produces the output:
Deletions:
Revision [22645]
Edited on 2019-03-29 10:46:09 by fxm [Suppressed the type declaration that is redundant when resizing a dynamic array (in examples)]Additions:
Redim foo(0 To 2)
Deletions:
Additions:
##**Common**## variables cannot be initialized.
##**Common**## arrays are always variable-length, and must be defined with an empty parameter list ##()##, and its dimensions set in a later ##[[KeyPgDim|Dim]]## or ##[[KeyPgRedim|Redim]]## statement.
##**Common**## variables cannot be instances of a user-defined type having a constructor or a destructor even implicit.
The ##**Shared**## optional parameter makes the variable global so that it can be used inside ##[[KeyPgSub|sub]]##s and ##[[KeyPgFunction|function]]##s, as well as at module level.
##**Common**## arrays are always variable-length, and must be defined with an empty parameter list ##()##, and its dimensions set in a later ##[[KeyPgDim|Dim]]## or ##[[KeyPgRedim|Redim]]## statement.
##**Common**## variables cannot be instances of a user-defined type having a constructor or a destructor even implicit.
The ##**Shared**## optional parameter makes the variable global so that it can be used inside ##[[KeyPgSub|sub]]##s and ##[[KeyPgFunction|function]]##s, as well as at module level.
Deletions:
Additions:
Additions:
**Common** [[[KeyPgShared|Shared]]] //symbolname//[()] [AS [[DataType|DataType]]] [, ...]
The ##**Shared**## optional parameter makes the variable global so that it can be used inside ##[[KeyPgSub|sub]]##s and ##[[KeyPgFunction|function]]##s, as well as at module level. ##**Common**## arrays are always variable-length, and must be defined with an empty parameter list ##()##, and its dimensions set in a later ##[[KeyPgDim|Dim]]## or ##[[KeyPgRedim|Redim]]## statement.
- ##[[KeyPgDim|Dim]]##
- ##[[KeyPgErase|Erase]]##
- ##[[KeyPgExtern|Extern]]##
- ##[[KeyPgLbound|Lbound]]##
- ##[[KeyPgRedim|Redim]]##
- ##[[KeyPgPreserve|Preserve]]##
- ##[[KeyPgShared|Shared]]##
- ##[[KeyPgStatic|Static]]##
- ##[[KeyPgUbound|Ubound]]##
- ##[[KeyPgVar|Var]]##
The ##**Shared**## optional parameter makes the variable global so that it can be used inside ##[[KeyPgSub|sub]]##s and ##[[KeyPgFunction|function]]##s, as well as at module level. ##**Common**## arrays are always variable-length, and must be defined with an empty parameter list ##()##, and its dimensions set in a later ##[[KeyPgDim|Dim]]## or ##[[KeyPgRedim|Redim]]## statement.
- ##[[KeyPgDim|Dim]]##
- ##[[KeyPgErase|Erase]]##
- ##[[KeyPgExtern|Extern]]##
- ##[[KeyPgLbound|Lbound]]##
- ##[[KeyPgRedim|Redim]]##
- ##[[KeyPgPreserve|Preserve]]##
- ##[[KeyPgShared|Shared]]##
- ##[[KeyPgStatic|Static]]##
- ##[[KeyPgUbound|Ubound]]##
- ##[[KeyPgVar|Var]]##
Deletions:
The ##**Shared**## optional parameter makes the variable global so that it can be used inside ##[[KeyPgSub sub]]##s and ##[[KeyPgFunction function]]##s, as well as at module level. ##**Common**## arrays are always variable-length, and must be defined with an empty parameter list ##()##, and its dimensions set in a later ##[[KeyPgDim Dim]]## or ##[[KeyPgRedim Redim]]## statement.
- ##[[KeyPgDim Dim]]##
- ##[[KeyPgErase Erase]]##
- ##[[KeyPgExtern Extern]]##
- ##[[KeyPgLbound Lbound]]##
- ##[[KeyPgRedim Redim]]##
- ##[[KeyPgPreserve Preserve]]##
- ##[[KeyPgShared Shared]]##
- ##[[KeyPgStatic Static]]##
- ##[[KeyPgUbound Ubound]]##
- ##[[KeyPgVar Var]]##
Additions:
The ##**Shared**## optional parameter makes the variable global so that it can be used inside ##[[KeyPgSub sub]]##s and ##[[KeyPgFunction function]]##s, as well as at module level. ##**Common**## arrays are always variable-length, and must be defined with an empty parameter list ##()##, and its dimensions set in a later ##[[KeyPgDim Dim]]## or ##[[KeyPgRedim Redim]]## statement.
- ##//blockname//## is not needed and must be removed because the order of declaration no longer matters, only the symbol names.
- ##//blockname//## is not needed and must be removed because the order of declaration no longer matters, only the symbol names.
Deletions:
- ##/blockname/## is not needed and must be removed because the order of declaration no longer matters, only the symbol names.