Translator directives, Translator directives -2 – Rockwell Automation 1747-PBASE BASIC Development Software Programming Manual User Manual

Page 74

Advertising
background image

Publication 1746-PM001A-US-P

6-2 Writing Programs Using the BASIC Development Language

The initial statement

{$I INCLUDE.BDL}

is called a translator directive. There are

several translator directives described in the next section of this chapter; however,
this particular one has to be included in the beginning of your BASIC development
language programs if you want to use any of the BASIC programming macros. It
directs the 1747-PBASE Translator to a file called INCLUDE.BDL at the time the
file is translated. This file contains the programming macros described in Appendix
A of this manual.

The command

PRINT_DATE()

is one of those BASIC programming macros from

the INCLUDE.BDL file. A programming macro is like a BASIC subroutine that
has already been created for you. If you look through appendix A, you see that
there are close to 100 macros, including many with single or multiple variables.

To summarize, the core of the BASIC development language is the BASIC
language. The BASIC development language enhances the BASIC language by
offering translator directives and programming macros in an open format that does
not require line numbering.

Translator Directives

When you write a program using the BASIC development language, it eventually
must be translated to the BASIC language for downloading to the BASIC or
BASIC-T module. Translation is performed by the 1747-PBASE Translator
software.

This translation software is driven by translator directives that are included in a
program. These directives result in the simplified, open format of the BASIC
development language being translated to the commands and format of the BASIC
language. The following is a list of BASIC translator directives:

Comment

(Remark)

Any text located within { } curly brackets are program comments which are not
included in the translated program. Remarks (which are not translator directives,
mentioned here for comparison only) are included in the translated program. Both
of these can be used as an aid in debugging as well as program documentation.
Memory limitations of the BASIC or BASIC-T module may dictate that you use
more comments and fewer remarks.

IMPORTANT

If you are using the 1771-DB/B, you must also include the line:

{$I INCLUDBB.BDL}

.

Advertising