Microsoft KB Archive/35249

From BetaArchive Wiki
Knowledge Base


Correction for MHex$ IEEE Number Format Example for 4.00

Article ID: 35249

Article Last Modified on 11/21/2006



APPLIES TO

  • Microsoft QuickBasic 4.0



This article was previously published under Q35249

SUMMARY

Page 19 in some copies of the "Microsoft QuickBasic 4.0: Basic Language Reference" (for version 4.00) gives four incorrect statements in the source code for MHex$. MHex$ is a user-defined FUNCTION that displays the internal format for IEEE floating point (single and double precision) numbers.

The incorrect statements give an integer overflow message because a "multiply by 256" should actually be an "integer divide by 256." The corrections are shown below.

This documentation error is corrected in a later release of the manuals for QuickBasic 4.00, in 4.00b, and also in the "QuickBasic 4.5: Basic Language Reference" (sold separately from version 4.50 using an order card provided with the version 4.50 package) and on page 703 of the "Microsoft Basic 7.0: Programmer's Guide."

MORE INFORMATION

The following is the correct text for page 19 of the "QuickBasic 4.0: Basic Language Reference:"

line 6: ' Note that the AND removes unwanted bits; dividing by 256
line 7: ' shifts the value right 8 bit positions.
line 10: Bytes(I)=AsLong& AND &HFF&
line 11: AsLong& \ 256&

This correction is necessary only in certain early copies of the manual shipped with QuickBasic version 4.00 and is not necessary in a later edition of the manual shipped in the version 4.00 package.

The following is the incorrect text in earlier QuickBasic version 4.00 manuals:

line 6: 'Note that dividing shifts the bytes right, and the AND
line 7: ' removes unwanted bits.
line 10: Bytes(I) = AsLong& \ Shift& AND &HFF&
line 11: Shift&=Shift&*256


Additional query words: QuickBas

Keywords: KB35249