Overview of the language, Chapter 6, Overview of the language -1 – Rockwell Automation 1747-PBASE BASIC Development Software Programming Manual User Manual

Page 73: Chapter

Advertising
background image

1

Publication 1746-PM001A-US-P

Chapter

6

Writing Programs Using the BASIC Development
Language

This chapter is designed to help you write programs using the BASIC development
language. It begins with an overview of the language. Other topics include:

translator directives

keystroke and programming macros

program integration from separate files

second program creation

Overview of the
Language

The BASIC Language Reference Manual (publication number
1746-RM001A-US-P) and the SLC 500™ BASIC and BASIC-T Modules User
Manual
(publication number 1746-UM004A-US-P) define the syntax that
provides the core of the BASIC development language. This core is then enhanced
by the addition of translator directives and programming macros, all structured to a
simple, open format that requires no line numbers. Descriptive label references are
used as destinations for transferring control, instead of line numbers.

As an example, a BASIC development language program for printing the date is
shown below. It uses a translator directive and a programming macro, and
translates to about nine lines in BASIC. That means if you were not using the
BASIC development language, instead of typing the three lines on the left, you
would have to type in the eleven lines on the right.

REM EXAMPLE PROGRAM

0 REM ...

{$I INCLUDE.BDL}

10 REM EXAMPLE PROGRAM

PRINT_DATE()

20 PUSH A

30 CALL 44

40 POP A

50 P. A,”/”,

60 POP A

70 P. A,”/”,

80 POP A

90 P. A,” ”,

100 POP A

Advertising