BASIC stamp manual v2.2

3: Using the BASIC Stamp Editor
BASIC Stamp Syntax and Reference Manual 2.2 www.parallax.com Page 43
Compiler Directives
The BASIC Stamp Editor supports all of the BASIC Stamp models, and all
versions of the PBASIC programming language. Compiler directives must
be placed in each program to indicate the desired BASIC Stamp model and
language version. In addition, it is sometimes useful to target a given
program to a particular communication port. The Directive menu contains
options for setting the $STAMP, $PBASIC, and $PORT directives. Since
the $STAMP and $PBASIC directives are used most often, they are most
easily inserted or modified with the toolbar buttons, as shown in Figure
3.9.
Figure 3.9: Toolbar icons make it
easy to insert or modify $STAMP
and $PBASIC directives directly in
your program.
A $STAMP directive is required in each PBASIC program. The editor
determines which BASIC Stamp model to target for compiling and
downloading based on this directive. Any code that is missing the
$STAMP directive, but whose filename contains a known BASIC Stamp
extension (.bs1, .bs2, .bse, .bsx, .bsp, .bpe, .bpx) will be recognized by that
extension and an appropriate $STAMP directive will be added
automatically when you run, tokenize, view the memory map or
download the program. If there is no file extension present, an error
message will prompt you to enter a $STAMP directive.
You may choose to manually type the $STAMP directive into the program
from the keyboard. This line should be entered into your code on a line by
itself, usually near the top. Note that the directive appears on a comment
line, as indicated by the apostrophe (').
' {$STAMP BS1} 'This indicates to use a BASIC Stamp 1 module
' {$STAMP BS2} 'This indicates to use a BASIC Stamp 2 module
' {$STAMP BS2e} 'This indicates to use a BASIC Stamp 2e module
' {$STAMP BS2sx} 'This indicates to use a BASIC Stamp 2sx module
' {$STAMP BS2p} 'This indicates to use a BASIC Stamp 2p module
' {$STAMP BS2pe} 'This indicates to use a BASIC Stamp 2pe module
' {$STAMP BS2px} 'This indicates to use a BASIC Stamp 2px module
C
OMPILER DIRECTIVES .
FORMAT OF THE $STAMP DIRECTIVE.
THE $STAMP DIRECTIVE.