FIX: UAE/GPF When Square Brackets '[]' Around MSGBOX Function

Last reviewed: October 30, 1997
Article ID: Q93425
2.00 WINDOWS kbenv kbbuglist

The information in this article applies to:

- Standard Edition of Microsoft Visual Basic for Windows, version 2.0

SYMPTOMS

If you enclose an identifier which has a total length of 40 or more characters in square brackets ("[]"), an Unrecoverable Application Error (UAE) or General Protection (GP) fault occurs.

STATUS

Microsoft has confirmed this to be a problem in the Standard Edition of Microsoft Visual Basic for Windows, version 2.0. This problem was corrected in Microsoft Visual Basic version 3.0 for Windows.

Square brackets are used when you have an identifier with the same name as a reserved word, and you need to specify that this occurrence of the word is an identifier, and not a use of a reserved word). Identifiers in Visual Basic for Windows, version 2.0 are limited to 40 characters in length.

MORE INFORMATION

The following steps can be used to reproduce this problem:

  1. Start VB.EXE.

  2. Select the New Module routine from the File menu to add Module1.BAS.

  3. Add the following to the general declarations section of Module1.BAS:

       ' The following statement should appear on one line.
       [BUTTON = MSGBOX("SOME OR ALL OF THE DATES ARE OUT OF RANGE OR
         WERE NOT PROPERLY FORMATTED AND HAVE BEEN RESET TO TODAY'S DATE.
         THE VALID RANGE FOR DATES IS " + RANGE + " AND SHOULD BE IN THE
         FORMA]
    
    

  4. Note the above section of text is on four lines. Place the cursor at the end of the first line and press the Delete key, this appends the second line to the end of the first line. Press the End key to place the cursor at the end of the new first line, and then press the Delete key again, this should append the third line to end of the first line. Proceed on by pressing the End key one more time to place the cursor at the end of the first line. Then press the Delete key again, and this should append the fourth and last line to the first line.

  5. With the cursor at the end of new long first line, press the Enter or Return key. A UAE or GPF occurs.

    Note: If you try the example above in an event procedure of a procedure

             defined by the user, the same problem occurs.
    


Additional reference words: buglist2.00 fixlist3.00 2.00 3.00
KBCategory: kbenv kbbuglist
KBSubcategory: EnvtDes
Solution Type : kbfix


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.

Last reviewed: October 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.