BASIC stamp manual v2.2
5: BASIC Stamp Command Reference – DEBUG
BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com • Page 161
After running the above code, "x = $4B" and "x = %01001011" should
appear on the screen. To display hexadecimal or binary values without
the "symbol = " preface, use the value formatter (#) before the $ and %, as
shown below:
SYMBOL x = B2
x = 75
DEBUG #x, "as HEX is ", #$x ' displays "75 as HEX is $4B"
DEBUG #x, "as BINARY is ", #%x ' displays "75 as BINARY is %01001011"
To display a number as its ASCII character equivalent, use the ASCII
formatter (@).
SYMBOL x = B2
x = 75
DEBUG @x
Table 5.10: DEBUG Formatters for
the BASIC Stamp 1.
Formatter Description
#
Suppresses the "symbol = x" format and displays only the 'x' value.
The default format is decimal but may be combined with any of the
formatters below (ex: #x to display: x value)
@
Displays "symbol = 'x'" + carriage return; where x is an ASCII
character.
$ Hexadecimal text.
% Binary text.
Two pre-defined symbols, CR and CLS, can be used to send a carriage-
return or clear-screen command to the Debug Terminal. The CR symbol
will cause the Debug Terminal to start a new line and the CLS symbol will
cause the Debug Terminal to clear itself and place the cursor at the top-left
corner of the screen. The following code demonstrates this.
DEBUG "You can not see this.", CLS, "Here is line 1", CR, "Here is line 2"
When the above is run, the final result is "Here is line 1" on the first line of
the screen and "Here is line 2" on the second line. You may or may not
have seen "You can not see this." appear first. This is because it was
immediately followed by a clear-screen symbol, CLS, which caused the
display to clear the screen before displaying the rest of the information.
NOTE: The rest of this discussion does not apply to the BASIC Stamp 1.
USING CR AND CLS (BS1).
D
ISPLAYING ASCII CHARACTERS (BS1).