"Overflow" from "&H nn" or "&O nn" with Illegal Embedded Space (64592)



The information in this article applies to:

  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1

This article was previously published under Q64592

SUMMARY

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.

MORE INFORMATION

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).

Modification Type:MinorLast Reviewed:1/9/2003
Keywords:KB64592