Use && to Display Ampersand Character in MsgBox Text

ID: Q96068


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0


SYMPTOMS

The MsgBox statement and the MsgBox function fail to display the ampersand (&) character in the message text. The MsgBox statement incorrectly interprets the ampersand as indicating that the next character is an access key, as in label captions.


WORKAROUND

To work around the problem, write two ampersands in a row (&&) to cause one ampersand to appear in the message.


STATUS

Microsoft has confirmed this to be a bug in both the Standard and Professional Editions of Microsoft Visual Basic version 1.0 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


MORE INFORMATION

The following statement reproduces the problem:


   MsgBox "a & b" 
This incorrectly displays a b. To correct this example, use &&:

   MsgBox "a && b" 
This incorrectly displays a & b.

Additional query words: VBmsdos buglist1.00 1.00

Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.