Label -4, Label – Rockwell Automation 1747-PBASE BASIC Development Software Programming Manual User Manual

Page 76

Advertising
background image

Publication 1746-PM001A-US-P

6-4 Writing Programs Using the BASIC Development Language

For this example, we have included the file FIRST.BDL. Its name was entered in an
include directive, and the entire program appeared after translation.

During translation, the translator first looks to see if there is a DOS path specified
with the include directive to indicate where the file FIRST.BDL can be found. For
example, you could use:

{$I A:\FIRST.BDL}

if the file FIRST.BDL is on the A: disk drive,

or

{$I C:\ABBASIC\BDS\FIRST.BDL}

if the file FIRST.BDL is in the BDS

subdirectory of the BASIC Development Software.

If no DOS path is specified with the include directive, then the translator looks to
see if a DOS path is specified in the translator’s command line. This is described in
Chapter 8.

If there is no DOS path specified in either the include directive or the translator’s
command line, then the translator searches the current working directory for the
file FIRST.BDL.

In either of these three cases, if the file is not found, then

Error 25: File not

found

appears in the message line during translation.

Label

Labels are used instead of line numbers to reference a target location in a program.
A symbolic label is used anywhere you would have used a program line number in
BASIC to reference a branch or jump location. This makes programs easier to read
and understand, and there is no need to renumber the program after changes are
made.

The label name is a string of up to 30 ASCII characters. The character set is defined
to be [0..9, A..Z, a..z,_]. The label name cannot contain any tabs or spaces and
must begin with a letter.

IMPORTANT

The file INCLUDE.BDL comes as part of the BASIC
Development Software package. It contains the BASIC
programming macros and the information necessary to translate
them. Therefore, the statement

{$I INCLUDE.BDL}

should

appear at the beginning of any program in which you intend to
use the programming macros.

Advertising