DEBUG - BASIC Stamp Command Reference
Page 104
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
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 6.4). The Debug Terminal in the Windows version of
the editor supports all the control characters in Table 6.4, while the DOS
version only supports a few of them.
Some 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 control character is perhaps the most unique of the set. 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":
DEBUG 2, 4, 5, "Hello"
The upper-left cursor position is 0,0 (that is column 0, row 0). The right-
most cursor positions depend on the size of the Debug Terminal window
(which is user adjustable). If a character position that is out of range is
F
IXED
-
WIDTH STRINGS
.
R
EPEATING CHARACTERS
.
S
PECIAL
C
ONTROL CHARACTERS
.
Summary of Contents for BASIC Stamp 1
Page 1: ...BASIC Stamp Programming Manual Version 2 0c...
Page 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...