Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- QuickBASIC 3.0 - <b>common pass variables to chained program or subprogram</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
COMMON                   Pass Variables to CHAINed Program or Subprogram

 COMMON [SHARED] [/blockname/] varlist

    Passes variables to a chained-to program or a subprogram.

      SHARED    An optional attribute. The COMMON statement must appear in
                both the calling program and the chained-to program or
                subprogram--unless the subprogram is in the same module as
                the calling program and the SHARED attribute is used in
                the calling program's COMMON statement.

   blockname    Any valid BASIC identifier; the first 31 characters are
                significant. Allows you to name a group of common
                variables. A group of variables passed with a blockname is
                called a named COMMON block; variables passed without a
                blockname are called a blank COMMON block.

     varlist    One or more scalar or array variables to be shared with a
                chained-to program or a subprogram.

   ----------------------------------------------------------------------

      Notes:    The order in which variables appear in varlist is
                significant, not the names of the variables. To avoid type
                mismatches and other calamities, it's advisable to put all
                shared variables in a COMMON statement in a separate file,
                then $INCLUDE that file in both the calling program and
                any chained-to programs or subprograms.

                The COMMON statement must appear before any executable
                statements. Nonexecutable statements are CONST, DATA,
                COMMON, DEFtype, DIM (for static arrays), OPTION BASE,
                comments, and metacommands.

                If a static array is to be passed to a chained-to program
                or subprogram, its DIM statement must appear before the
                COMMON statement. The DIM statement must use integer-
                constant subscripts.

                If a dynamic array is to be passed, it must be DIMmed or
                REDIMmed after the COMMON statement.

                When passing a named COMMON block to a program in the user
                library, the calling program may not redefine the block to
                a larger size. Blank COMMON blocks may be resized.

                When COMMON is used with CHAIN and compilation is done
                outside the QuickBASIC environment, the BRUN20.EXE library
                (QB's default) must be used.

See Also: CALL CHAIN SUB...END SUB

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson