qb45advr.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
◄QuickSCREEN► ◄Details► ◄Example► ◄Contents► ◄Index►
──────────────────────────────────────────────────────────────────────────────
SHARED Statement Details
Syntax
SHARED variable [AS type] [,variable [AS type]]...
The argument variable is either an array name followed by () or a variable
name. The AS clause can be used to indicate the variable's type. The type
argument can be INTEGER, LONG, SINGLE, DOUBLE, STRING, fixed-length string
(STRING * length), or a user-defined type.
By using either the SHARED statement in a SUB or FUNCTION procedure, or the
SHARED attribute with COMMON or DIM in the module-level code, you can use
variables in a procedure without passing them as parameters. The SHARED
attribute shares variables among all procedures in a module, while the
SHARED statement shares variables between a single procedure and the
module-level code.
Note: The SHARED statement only shares variables 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. The SHARED statement only shares
variables between the module-level code and a SUB or FUNCTION
in the same module.
The SHARED statement can appear only in a SUB or FUNCTION.