Microsoft KB Archive/35329: Difference between revisions
m (Text replacement - ">" to ">") |
m (Text replacement - "&" to "&") |
||
Line 44: | Line 44: | ||
== MORE INFORMATION == | == MORE INFORMATION == | ||
The following program incorrectly prints the long-integer variable (a& | The following program incorrectly prints the long-integer variable (a&) as 0 (zero) in Microsoft QuickBasic (d) interpreter, but correctly prints "123456789" when compiled: | ||
<pre class="codesample"> a& | <pre class="codesample"> a& = 123456789& | ||
PRINT USING "##########";a& | PRINT USING "##########";a& | ||
</pre> | </pre> | ||
(Appending ampersand (& | (Appending ampersand (&) to a variable name makes it a long integer.)<br /> | ||
<br /> | <br /> | ||
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: | 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: | ||
<pre class="codesample"> a& | <pre class="codesample"> a& = 123456789& | ||
temp# = a& | temp# = a& | ||
PRINT USING "##########";temp# | PRINT USING "##########";temp# | ||
</pre> | </pre> |
Latest revision as of 14:14, 21 July 2020
Article ID: 35329
Article Last Modified on 11/21/2006
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#
Additional query words: MQuickB
Keywords: kbbug KB35329