Creating A Second Program; Entering The Program - Allen-Bradley 1747-PBASE Programming Manual

Basic development software
Table of Contents
Creating a Second
Program
In Chapter 2, you created a simple program. Following is a more complex program
to illustrate many of the programming features described. It includes using
programming macros, labels, and line-draw.
After you type in this BASIC development language program, translating,
downloading, and executing it on your BASIC or BASIC-T module is briefly
described.
Saving a file with a .BDL extension before you begin working on it causes the
attributes for that extension to be used while you edit. Features such as indent
style, tab spacing, right margin, word wrap, and language type are established for
you.

Entering the Program

1. Pull down the File menu.
2. Select
save file As.
3. Type:
SECOND.BDL
4. Press [Enter], or move the mouse cursor to
button. The
SAVE FILE AS
C:\ABBASIC\BAS\SECOND.BDL Saved
5. Type the first two lines of the Second program:
REM SECOND PROGRAM
{will print screen below, then check operator number}
Note that they are comments because they are enclosed in
comments are not translated. If you want these lines in the translated BASIC
file, use
instead of
REM
by five spaces to make them stand out.
6. Type
{$I Include.bdl}
{$I Include.bdl}
by a
.
is the include translator directive requesting that a separate file
$
$I
(
in this case) be included during translation. Include.bdl is the
Include.bdl
file available with the BASIC Development Software that contains
programming macros. As you become more familiar with the BASIC
Development Software, you may wish to create your own file,
example, that contains your own programming macros. You could then
include it during translation by beginning your program with the command
.
{$I Mine.bdl}
Writing Programs Using the BASIC Development Language
The
dialog box appears on the screen.
SAVE FILE AS
OK
dialog box disappears, and the message
appears in the message line.
. We have indented all comments in this example
{ }
is not a comment because the
6-11
and click the left mouse
. Remember,
{ }
is followed immediately
{
for
mine.bdl
Publication 1746-PM001A-US-P

Hide quick links:

Table of Contents
loading

Table of Contents