◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back► ────────────────────────────────────────────────────────────────────────────── SHARED variable[()] [AS type] [,variable[()] [AS type]]... Usage Notes ■ The SHARED statement shares variables between a single procedure and the module-level code. In contrast, the SHARED keyword used with COMMON or DIM shares variables among all procedures in a module. See: ◄COMMON Statement► ◄DIM Statement► ■ The SHARED statement can appear only in a SUB or FUNCTION procedure. ■ The SHARED statement shares variables only: • Within a single compiled module; it does not share variables with programs in the Quick library or with procedures compiled separately and linked to the program • Between the module-level code and a SUB or FUNCTION procedure in the same module See: ◄FUNCTION Statement► ◄SUB Statement► ■ To access variables in a procedure without passing them as parameters, you can use either: • A SHARED statement in a SUB or FUNCTION procedure • A SHARED keyword with COMMON or DIM in the module-level code See: ◄COMMON Statement► ◄SHARED Keyword► ◄FUNCTION Statement► ◄SUB Statement►