KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q52092: "Subscript out of Range in Quick Library Module: MENU" in 7.00

Article: Q52092
Product(s): See article
Version(s): 7.00
Operating System(s): MS-DOS
Keyword(s): ENDUSER | SR# S891207-103 | mspl13_basic
Last Modified: 2-MAY-1990

A program that uses procedures in the User Interface Toolbox's
WINDOW.BAS source-code file may generate the message "Subscript out
of range in module: MENU," if either the global-array declarations
used with MENU.BAS are not included in the program or if they are
included in the wrong order.

This information applies to Microsoft BASIC Professional Development
System (PDS) version 7.00 for MS-DOS.

When using procedures in WINDOW.BAS, you must include the global-array
declarations used with MENU.BAS in addition to the global-array
declarations that are specific to WINDOW.BAS.

The MENU.BAS COMMON SHARED statements must be listed before the
WINDOW.BAS COMMON SHARED statements or a "Subscript out of range in
module: MENU" error occurs.

When using procedures in WINDOW.BAS, you make the following
global-array declarations in your program. The COMMON SHARED
statements must be listed in the exact order shown. The order of the
DIM statements does NOT matter.

'COMMON SHARED statements to be used with MENU.BAS:

        COMMON SHARED /uitools/ GloMenu       AS MenuMiscType
        COMMON SHARED /uitools/ GloTitle()    AS MenuTitleType
        COMMON SHARED /uitools/ GloItem()     AS MenuItemType

'COMMON SHARED statements WINDOW.BAS:

        COMMON SHARED /uitools/ GloWindow()   AS WindowType
        COMMON SHARED /uitools/ GloButton()   AS ButtonType
        COMMON SHARED /uitools/ GloEdit()     AS EditFieldType
        COMMON SHARED /uitools/ GloStorage    AS WindowStorageType
        COMMON SHARED /uitools/ GloWindowStack() AS INTEGER
        COMMON SHARED /uitools/ GloBuffer$()

'DIM statements to be used with MENU.BAS:

        DIM GloTitle(MAXMENU)                 AS MenuTitleType
        DIM GloItem(MAXMENU, MAXITEM)         AS MenuItemType

'DIM statements to be used with WINDOW.BAS:

        DIM GloWindow(MAXWINDOW)              AS WindowType
        DIM GloButton(MAXBUTTON)              AS ButtonType
        DIM GloEdit(MAXEDITFIELD)             AS EditFieldType
        DIM GloWindowStack(MAXWINDOW)         AS INTEGER
        DIM GloBuffer$(MAXWINDOW + 1, 2)

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.