BUG: Decimal Math QuickBasic, PRINT USING <Long Int> Gives 0 (35329)






This article was previously published under Q35329

SYMPTOMS

In Microsoft QuickBasic (d) (decimal-math version) Version 1.00, when a variable of long integer type is printed with a PRINT USING statement, incorrect (or zero) values are printed. This problem occurs only in the decimal-math interpreter.

Microsoft has confirmed this to be a bug in Microsoft QuickBasic (d) Version 1.00. We are researching this problem and will post new information as it becomes available.

This problem does not occur in a compiled decimal-math program or in the binary-math QuickBasic (b) compiler or interpreter.

MORE INFORMATION

The following program incorrectly prints the long-integer variable (a&) as 0 (zero) in Microsoft QuickBasic (d) interpreter, but correctly prints "123456789" when compiled:
   a& = 123456789&
   PRINT USING "##########";a&
				
(Appending ampersand (&) to a variable name makes it a long integer.)

To work around the problem in decimal math QuickBasic interpreter, you can assign the long integer variable to a single- or double-precision temporary variable, which can be successfully printed with the PRINT USING statement, as follows:
   a& = 123456789&
   temp# = a&
   PRINT USING "##########";temp#
				

Modification Type: Minor Last Reviewed: 1/8/2003
Keywords: kbbug KB35329