FIX: x MOD 65536& Gives System Error ID=2 in Interpreter (45947)



The information in this article applies to:

  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0

This article was previously published under Q45947

SYMPTOMS

Using the MOD operator (modulo arithmetic) with a divisor of 65,536 causes a "Division by Zero Error" and a System Bomb with system error ID=02. Other long integer or integer divisors show no problem. This error occurs in both the Binary and Decimal versions of QuickBasic's environment. The problem does not appear in compiled applications.

Microsoft has confirmed this to be a bug with the interpreter in Microsoft QuickBasic version 1.00 for the Macintosh . This problem is corrected in QuickBasic version 1.00b.

Code Example

   PRINT 10 MOD 65536&  ' Should print 10, but crashes interpreter.
				
Note that the QuickBasic editor is designed to automatically append an ampersand (&) character to long-integer constants. 65,536 is equal to 64K (64 times 1024).

Modification Type:MinorLast Reviewed:1/8/2003
Keywords:kbbug KB45947