BASIC stamp manual v2.2
3: Using the BASIC Stamp Editor
BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com • Page 45
any BS2 model source code. A $PBASIC directive is required to use
version 2.5, which is compatible with all BS2 models.
PBASIC 2.5 has enhanced syntax options for several commands, as well as
some additional commands not available in PBASIC 2.0. Table 3.4 shows
the number of PBASIC commands that are available in each version of the
PBASIC language, on each BASIC Stamp model. Details about the syntax
differences among the three versions of PBASIC are denoted by icons in
the margins of Chapters 4 and 5; also refer to Table 5.1 on page 124 and
individual command syntax descriptions.
Table 3.4: Number of Available
Commands for each BASIC
Stamp Model with each version
of the PBASIC language .
BS1 BS2 BS2e BS2sx BS2p BS2pe BS2px
PBASIC 1.0
32 - - - - -
-
PBASIC 2.0
- 37 40 40 56 56
58
PBASIC 2.5
- 42 45 45 61 61
63
A categorical listing of all PBASIC commands is included at the beginning of Chapter 5,
followed by detailed descriptions of each command in alphabetical order.
Note that the syntax-highlighting feature of the BASIC Stamp Editor will
also adjust to the language version indicated by the $PBASIC directive.
The best way to select the $PBASIC directive is to use the toolbar icons, as
was shown in Figure 3.9. Like the $STAMP directive, you must use care if
you choose to type it in by hand. The syntax is:
' {$PBASIC 1.0} 'Default when a BASIC Stamp 1 module is detected
' {$PBASIC 2.0} 'Default when any BASIC Stamp 2 module is detected
' {$PBASIC 2.5} 'Required for PBASIC 2.5 command set & enhanced syntax
If you try to run a program that contains command syntax specific to
PBASIC 2.5 without including the corresponding compiler directive, you
will probably get an error message. In this case, insert a $PBASIC 2.5
directive and try running the program again.
The optional $PORT directive allows you to indicate a specific PC
communications port through which to download a program to a BASIC
Stamp module. The syntax is as follows:
' {$PORT COM#}
where # is a valid port number. When any PBASIC program containing
this directive is downloaded, all other ports will be ignored. This directive
is especially convenient when using two of the same BASIC Stamp models
THE $PORT DIRECTIVE.