KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q64592: "Overflow" from "&H nn" or "&O nn" with Illegal Embedded Space

Article: Q64592
Product(s): See article
Version(s): 4.00 4.00b 4.50
Operating System(s): MS-DOS
Keyword(s): ENDUSER | B_BasicCom | mspl13_basic
Last Modified: 10-AUG-1990

The ampersand character, when used to signify Hexadecimal (&H) or
Octal (&O) values, can give an "Overflow" error if a space is embedded
in the number.

This information applies to QuickBASIC versions 4.00, 4.00b, and 4.50,
to Microsoft BASIC Compiler versions 6.00 and 6.00b, and to Microsoft
BASIC Professional Development System (PDS) versions 7.00 and 7.10 for
MS-DOS and MS OS/2.

The following code examples cause an "Overflow" error (in the QB.EXE
or QBX.EXE environment or in the BC.EXE compiler):

   AnyVarName = &H 80

   AnyVarName = & 80

   AnyVarName = &O 80

   PRINT &H 80

The QBX.EXE environment immediately displays this error message
because of the syntax checker, while the QB.EXE environment only
catches the error upon execution.

QuickBASIC compiler versions 3.00 and earlier ignore this syntax error
and interpret the faulty information as a zero (0).

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.