DEBUG - BASIC Stamp Command Reference
Expressions are allowed within the DEBUG command arguments as well.
In the above code, DEBUG DEC x+25 would yield "95" and DEBUG
DEC x*10/2-3 would yield "322".
Formatter
?
ASC ?
DEC{1..5}
SDEC{1..5}
HEX{1..4}
SHEX{1..4}
IHEX{1..4}
ISHEX{1..4}
BIN{1..16}
SBIN{1..16}
IBIN{1..16}
ISBIN{1..16}
STR bytearray
STR bytearray\n
REP byte\n
As seen in Table 6.3, special versions of the DEC, HEX and BIN formatters
allow for the display of indicated, signed and fixed-width numbers. The
term "indicated" simply means that a special symbol is displayed, before
the number, indicating what number system it belongs to. For example,
x
VAR
BYTE
x = 65
DEBUG HEX x
displays "41" (65, in decimal, is 41, in hexadecimal). You might see a
problem here... unless you knew the number was supposed to be
hexadecimal, you might think it was 41, in decimal... a totally different
number. To help avoid this, use the IHEX formatter (the "I" stands for
indicated). Changing the DEBUG line to read: DEBUG IHEX x would
print "$41" on the screen. A similar formatter for binary also exists, IBIN,
which prints a "%" before the number.
Page 100 • BASIC Stamp Programming Manual 2.0b • www.parallaxinc.com
Displays "symbol = x" + carriage return; where x is a number.
Default format is decimal, but may be combined with number
formatters below (ex: bin ? x to display "x = binary_number").
Displays "symbol = 'x'" + carriage return; where x is an ASCII
character.
Decimal text, optionally fixed for 1 to 5 digits.
Signed decimal text, optionally fixed for 1 to 5 digits.
Hexadecimal text, optionally fixed for 1 to 4 digits.
Signed hex text, optionally fixed for 1 to 4 digits.
Indicated hex text ($ prefix; ex.: $7A3), optionally fixed for 1 to 4
digits.
Indicated, signed hex text, optionally fixed for 1 to 4 digits.
Binary text, optionally fixed for 1 to 16 digits.
Signed binary text, optionally fixed for 1 to 16 digits.
Indicated binary text (% prefix; ex.: %1001), optionally fixed for 1
to 16 digits.
Indicated, signed binary text, optionally fixed for 1 to 16 digits.
ASCII string from bytearray until byte = 0.
ASCII string consisting of n bytes from bytearray.
Display ASCII character n times.
' Show hexadecimal value of x.
Description
E
DEBUG
XPRESSIONS IN
.
COMMANDS
Table 5.5: DEBUG Formatters.
D
"
"
ISPLAYING
INDICATED
NUMBERS
.
Need help?
Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?