advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
SHARED Statement Details
  ◄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►