BASIC stamp manual v2.2

Using the BASIC Stamp Editor
Page 70 BASIC Stamp Syntax and Reference Manual 2.2 www.parallax.com
The editor has the ability to treat projects as one logical unit and can
download each of the associated source code files at once. In order to
minimize download time for large projects a Project Download Mode is
available in the Preferences window. The available modes are: “Modified”
(the default), “All” or “Current” and are explained below. This item only
affects download operations for the BS2e, BS2sx, BS2p and BS2pe. See
Table 3.7.
Download Mode Function
Modified (default)
This mode will cause only the source code files that were
modified since the last download to be downloaded next time.
If no files have been modified since the last download, or the
entire project has just been loaded into the editor, all the files
will be downloaded next time. This mode decreases the delay
during downloading projects and should help speed
development and testing.
All
This mode will cause all the source code files to be
downloaded each time. This will be noticeably slow with large
projects.
Current
This mode will cause only the current source code file to be
downloaded, ignoring all the others. This mode can be helpful,
but can lead to development errors if you forget to download a
required program.
Table 3.7: Project Download
Modes.
Regardless of the download mode selected, the programs will be
downloaded into the program slot indicated in their tab.
Some source code may be suitable for multiple uses but requires changing
a set of constants as needed for each case. For example, you may want to
run the same program on a BS2 and a BS2sx, but the resolution of time-
sensitive commands is different, requiring slight code modifications.
Several conditional compile directives exist in PBASIC 2.5 to assist with
this situation. Table 3.8 lists the available directives.
Directive Function
#DEFINE
Allows the programmer to create custom symbols for use
within conditional compilation control structures.
#IF...#THEN...#ELSE
Evaluate Condition and, if it is True, compile the statement(s)
following #THEN, otherwise compile the statements following
#ELSE.
#SELECT...#CASE
Evaluate Expression and then conditionally compile a block of
code based on comparison to Condition(s). If no conditions are
found True and a #CASE ELSE block is included, the #CASE
#ELSE code statements will compiled.
#ERROR Allows the programmer to create a custom error dialog.
Table 3.8: Conditional Compile
Directives.
NOTE: These directives require
PBASIC 2.5.
PROJECT DOWNLOAD MODES.
C
ONDITIONAL COMPILE DIRECTIVES.