Parallax BASIC Stamp 2e Programming Manual page 106

Table of Contents

Advertisement

DEBUG - BASIC Stamp Command Reference
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).
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
Page 104 • BASIC Stamp Programming Manual 2.0b • www.parallaxinc.com
F
-
IXED
WIDTH STRINGS
R
EPEATING CHARACTERS
S
C
PECIAL
ONTROL CHARACTERS
The
.
.
.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents