DEBUG - BASIC Stamp Command Reference
Page 100
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
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
Description
?
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").
ASC ?
Displays "symbol = 'x'" + carriage return; where x is an ASCII
character.
DEC{1..5}
Decimal text, optionally fixed for 1 to 5 digits.
SDEC{1..5}
Signed decimal text, optionally fixed for 1 to 5 digits.
HEX{1..4}
Hexadecimal text, optionally fixed for 1 to 4 digits.
SHEX{1..4}
Signed hex text, optionally fixed for 1 to 4 digits.
IHEX{1..4}
Indicated hex text ($ prefix; ex.: $7A3), optionally fixed for 1 to 4
digits.
ISHEX{1..4}
Indicated, signed hex text, optionally fixed for 1 to 4 digits.
BIN{1..16}
Binary text, optionally fixed for 1 to 16 digits.
SBIN{1..16}
Signed binary text, optionally fixed for 1 to 16 digits.
IBIN{1..16}
Indicated binary text (% prefix; ex.: %1001), optionally fixed for 1
to 16 digits.
ISBIN{1..16}
Indicated, signed binary text, optionally fixed for 1 to 16 digits.
STR bytearray
ASCII string from bytearray until byte = 0.
STR bytearray\n
ASCII string consisting of n bytes from bytearray.
REP byte\n
Display ASCII character n times.
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 ' Show hexadecimal value of 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.
D
ISPLAYING
"
INDICATED
"
NUMBERS
.
E
XPRESSIONS IN
DEBUG
COMMANDS
.
Table 5.5: DEBUG Formatters.
Содержание BASIC Stamp 2e
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...