This repository has been archived on 2024-09-22. You can view files and clone it, but cannot push or open issues or pull requests.
pbi-ide/help/BasicStampHelp/Content/LanguageTopics/Reference/MultiFileProjects.htm

92 lines
7.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="6" MadCap:lastHeight="94" MadCap:lastWidth="853" MadCap:disableMasterStylesheet="true" MadCap:tocPath="PBASIC Language Reference" MadCap:InPreviewMode="false" MadCap:PreloadImages="false" MadCap:RuntimeFileType="Topic" MadCap:TargetType="WebHelp" lang="en-us" xml:lang="en-us" MadCap:PathToHelpSystem="../../../" MadCap:HelpSystemFileName="Default.xml" MadCap:SearchType="Stem">
<head><title>Multi-File Projects</title>
<link href="../../SkinSupport/MadCap.css" rel="stylesheet" />
<link href="../../Resources/Stylesheets/BSE_Help.css" rel="stylesheet" />
<script src="../../SkinSupport/MadCapAll.js" type="text/javascript">
</script>
</head>
<body>
<div class="MCBreadcrumbsBox_0"><span class="MCBreadcrumbsPrefix">You are here: </span><a class="MCBreadcrumbsLink" href="AlphaRef.htm">PBASIC Language Reference</a><span class="MCBreadcrumbsDivider"> &gt; </span><span class="MCBreadcrumbs">Multi-File Projects</span>
</div>
<h1>Multi-File Projects</h1>
<div class="ImagePlusCaption">
<div class="Col2">
<p>
<img src="../../graphics/pgm_icon2e.gif" border="0" alt="BS2e icon" title="BS2e icon" />
<img src="../../graphics/pgm_icon2sx.gif" border="0" alt="BS2sx icon" title="BS2sx icon" />
<img src="../../graphics/pgm_icon2p.gif" border="0" alt="BS2p icon" title="BS2p icon" />
<img src="../../graphics/pgm_icon2pe.gif" border="0" alt="BS2pe icon" title="BS2pe icon" />
<img src="../../graphics/pgm_icon2px.gif" border="0" alt="BS2px icon" title="BS2px icon" />
</p>
</div>
<p style="text-align: right;">&#160;</p>
<p>&#160;</p>
</div>
<p class="clear">&#160;</p>
<p>&#160;</p>
<p class="PlainText"><a name="Defining"></a>For BS2e, BS2sx, BS2p, BS2pe, and BS2px programs, each editor page can be a separate
project, or part of a single project. A project is a set of up to eight files that
should all be downloaded to the BASIC Stamp for a single application. Each of the
files within the project is downloaded into a separate "program slot". Only the
BASIC Stamp 2e, 2sx, 2p, 2pe, and 2px modules support multi-file projects.</p>
<h2>$STAMP Directive for a Multi-File Project</h2>
<p class="PlainText">For BASIC Stamp projects (consisting of multiple programs), the $STAMP directive
has an option to specify additional filenames. The syntax below demonstrates this
form of the $STAMP directive:</p><pre>
' {$STAMP BS2e, file2, file3, ..., file8}
</pre>
<p class="PlainText">Use this form of the $STAMP directive if a project, consisting of multiple files, is desired. This form of the directive must be entered only into the first program (to be downloaded into program slot 0). The file2, file3, etc. items should be the actual name (and optionally the path) of the other files in the project. File2 refers to the program that should be downloaded into program slot 1, file3 is the program that should be downloaded into program slot 2, etc. If no path is given, the filename is given the path of program 0 when loading them into the editor.</p>
<p class="PlainText">Up to seven filenames can be included, bringing the total to eight files in the project all together. Upon loading, tokenizing, running or viewing program 0 in the Memory Map, the editor will read the $STAMP directive, determine if the indicated files exist, will load them if necessary and change their captions to indicate the project they belong to and their associated program number. After the directive is tokenized properly, and all associated files are labeled properly, tokenizing, running or viewing any program in the Memory Map will result in that programs entire project being tokenized, downloaded or viewed.</p>
<p class="PlainText">When program #0 of a multi-file project is opened from diskette, the entire project will be loaded (all referenced files) as well. When a file that is part of a multi-file project is closed, the entire project (all the associated files) will be closed as well.</p>
<h2>Creating a Multi-File Project</h2>
<p class="PlainText">To create a project consisting of multiple files, follow these steps:</p>
<ol>
<li value="1">Create the first file in the editor and save it (we'll call it Sample.bsx). This will be the program that is downloaded into program slot 0.</li>
<li value="2">Create at least one other file in the editor and save it also (we'll call it NextProgram.bsx).</li>
</ol>
<p class="PlainTextIndent">Note: At this point the editor tabs will be:</p>
<p class="PlainTextIndent">0:Sample.bsx and 0:NextProgram.bsx.</p>
<p class="PlainTextIndent">...indicating that there are two unrelated files open "Sample.bsx" and "NextProgram.bsx" and each will be downloaded into program slot 0.</p>
<ol MadCap:continue="true">
<li value="3">Go back to the first program and enter or modify the $STAMP directive using the project format. Use "NextProgram" as the File2 argument. For example:</li>
</ol>
<p class="PlainTextIndent">' {$STAMP BS2sx, NextProgram.bsx}</p>
<ol MadCap:continue="true">
<li value="4">Then tokenize the code by pressing F7 or selecting Run → Check Syntax from the menu.</li>
</ol>
<p class="PlainText">At this point, the BASIC Stamp Editor will see the $STAMP directive and realize that this file (Sample.bsx) is the first file in a project and that the second file should be NextProgram.bsx. It will then search for the file on the hard drive (to verify its path is correct), will see that it is already loaded, and then will change the editor tabs to indicate the project relationship. At this point the editor tabs will be:</p>
<p class="PlainTextIndent">0:Sample.bsx and [Sample] 1:NextProgram.bsx.</p>
<p class="PlainText">...indicating that there are two related files open; "Sample.bsx" and "NextProgram.bsx". NextProgram.bsx belongs to the "Sample" project and it will be downloaded into program slot 1 and Sample.bsx will be downloaded into program slot 0.</p>
<div class="Col2">
<div class="MasterFoot">
<p MadCap:conditions="BSEconditions.BSEWebHelp (Primary)-INCLUDE"><a href="../../HomeTopics/HomePage.htm">Go to Welcome page</a>
</p>
</div>
</div>
<div class="Col2">
<div class="MasterFoot">
<p style="text-align: right;"><span class="ContactInfoProjectName">BASIC Stamp Help</span> <![CDATA[ ]]><span class="ContactInfoVersion#">Version 2.5.4</span> <![CDATA[ ]]></p>
<p style="text-align: right;">Copyright ©&#160;<span class="ContactInfoCompanyName">Parallax Inc.</span></p>
<p style="text-align: right;"><span class="SystemShortDate">8/8/2012</span>
</p>
</div>
</div>
<script type="text/javascript">/* <![CDATA[ */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-285614-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
/* ]]> */</script>
<script type="text/javascript" src="../../SkinSupport/MadCapBodyEnd.js">
</script>
</body>
</html>