BASIC stamp manual v2.2
5: BASIC Stamp Command Reference – DEBUG
BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com • Page 167
doesn't end with 0, the BASIC Stamp will read and output all RAM
register contents until it finds a 0 or until it cycles through all RAM
locations.
To specify a fixed-width format for the STR formatter, use the form
STR x\n; where x is the byte array and n is the number of characters to
print. Changing the DEBUG line in the example above to: DEBUG STR
x\2 would display "AB" on the screen.
If you need to display the same ASCII character multiple times, the REP
(repeat) formatter can help. REP takes the form: REP x\n ;where x is the
character and n is the number of times to repeat it. For example:
DEBUG REP "-"\10
would display 10 hyphens on the screen, "----------".
Since individual DEBUG instructions can grow to be fairly complicated,
and since a program can contain many DEBUGS, you’ll probably want to
control the character positioning of the Debug Terminal screen. DEBUG
supports a number of different control characters, some with pre-defined
symbols (see Table 5.13).
All of the control characters have pre-defined symbols associated with
them. In your DEBUG commands, you can use those symbols, for
example: DEBUG "Hello", CR displays "Hello" followed by a carriage
return. You can always use the ASCII value for any of the control
characters, however. For example: DEBUG "Hello", 13 is exactly the
same as the code above.
The Move To (x,y) control character allows positioning to a specific
column and row of the display. If the Debug Terminal receives this
character, it expects to see an x and y position value to follow (in the next
two characters received). The following line moves the cursor to column
number 4 in row number 5 and displays "Hello":
' {$PBASIC 2.5}
DEBUG CRSRXY, 4, 5, "Hello"
FIXED-WIDTH STRINGS.
R
EPEATING CHARACTERS.
S
PECIAL CONTROL CHARACTERS.