Language elements, Character set, The basic program line – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 15: Chapter 1, Character set -1 the basic program line -1, Chapter

Advertising
background image

1

Publication 1746-RM001A-US-P

Chapter

1

Language Elements

This chapter introduces you to the elements of a BASIC program. These elements
include BASIC:

line numbers

statements, commands, and operators

line length

Character Set

BASIC programs are composed of a group of BASIC program lines. Each BASIC
program line is composed of a group of ASCII characters. Refer to Appendix A for
a complete listing of ASCII character codes.

The BASIC Program Line

BASIC program lines consist of a BASIC line number and BASIC statements and
operators. BASIC program lines are restricted to the BASIC line length.

BASIC Line Numbers

We refer to BASIC line numbers as:

[ln num]

BASIC line numbers indicate the order that the program lines are stored in
memory and are also used as references when branching and editing. This number
may be any whole integer from 1 to 65535. Typically you start numbering BASIC
programs with line number 10 and increment by 10. This allows you to add
additional lines later as you work on your program.

Since the computer runs the statements in numerical order, additional lines need
not appear in consecutive order on the screen. If you enter line 35 after line 40, the
computer still runs line 35 after line 30 and before line 40. This technique saves
you from reentering an entire program if you forget to include a line.

IMPORTANT

The first line of your program must be a comment.

Advertising