BASIC stamp manual v2.2

Using the BASIC Stamp Editor
Page 44 BASIC Stamp Syntax and Reference Manual 2.2 www.parallax.com
If you choose to type the $STAMP directive, care must be taken, or it will
not be recognized. The directive itself must be enclosed in curly braces,
{…}, not parentheses (...) or square brackets [...]. There should not be
any spaces between the dollar sign ($) and the word STAMP; however, the
directive may contain additional spaces in certain other areas. For
example:
' { $STAMP BS2 }
-- or --
' {$STAMP BS2}
-- and --
' {$STAMP BS2 }
are all acceptable variations. However:
' {$ STAMP BS2}
-- and --
' {$STAMPBS2}
are not acceptable and will be ignored. If one of the above two lines were
entered into the source code, the editor would ignore it and, instead, rely
on the extension of the filename to determine the appropriate model.
The $STAMP directive is read and acted upon by the BASIC Stamp
Windows Editor any time a source code file is loaded, tokenized,
downloaded (run) or viewed in the Memory Map.
In some cases you may wish to write a program that can run on multiple
BASIC Stamp models. In this case, conditional compile directives can be
employed that will cause the editor to determine which Basic Stamp
model is detected, and then download only those program elements
applicable to that model. Many of the demo programs in Chapter 5 use
this technique. To read about conditional compilation, see the Advanced
Compilation Techniques section which begins on page 68.
The $PBASIC directive allows you to indicate which version of the
PBASIC language to use. At the time of this printing, the options are 1.0,
2.0 and 2.5. If no $PBASIC directive is present in the program, version 1.0
is assumed for BS1 module source code, and version 2.0 is assumed for
EXTRA SPACES ARE ALLOWED IN CERTAIN
AREAS
.
T
HE $PBASIC DIRECTIVE.
PROGRAMS FOR MULTIPLE BASIC STAMP
MODELS CONDITIONAL COMPILE.