Use Long Integer with PEEK, PEEKW, and PEEKL; SINGLE Can Fail (42550)
The information in this article applies to:
- Microsoft QuickBASIC Compiler for the Apple Macintosh
This article was previously published under Q42550 SUMMARY
Microsoft QuickBASIC for the Macintosh allows for the contents of
memory locations to be assigned to variables with the PEEK, PEEKW, or
PEEKL functions. PEEK returns one byte of information, PEEKW returns
one word (two bytes) of information, and PEEKL returns a double word
(four bytes).
The variable used to store a memory address should be of type long
integer.
If memory addresses are stored in SINGLE precision numbers, it is
possible (if the address is large enough) to lose one or more digits.
A SINGLE precision number may not be able to store memory addresses
that are sufficiently large (such as FFFFFF Hex). A DOUBLE precision
number has the capacity to represent high memory addresses, but
rounding or truncation may occur (as it also does in single precision)
because of the IEEE internal representation of floating-point numbers.
This will not be a problem with LONG integers.
Modification Type: | Minor | Last Reviewed: | 1/9/2003 |
---|
Keywords: | KB42550 |
---|
|