Statement: end, Statements: for – to – (step) – next – Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual

Page 59

Advertising
background image

Operating Functions

Chapter 5

5–22

Mode: RUN
Type: CONTROL

The END statement

terminates program execution. The continue comm

and, CONT does

not operate if the END statement is used to

terminate execution. A CAN’T CONTINUE ERROR prints to the console.
The last statement in a module program

automatically terminates

program execution

if you do not use an end statement. You should

always

use an END statement to terminate a program.

Examples:

END STATEMENT TERMINATION

u10 FOR I=1 TO 4

u20 GOSUB 100

u30 NEXT I

u40 END

u100 PRINT I

u110 RETURN

uRUN

1
2
3
4

READY

u

Variations:

None

Mode: RUN
Type: CONTROL

Use the

FOR – TO – (STEP) – NEXT statements to set up and control

loops.

Example:

u5 B=0: C=10 : D=2

u10 FOR A= B TO C STEP D

u20 PRINT A

u30 NEXT A

u40 END

5.4.10
Statement: END

5.4.11
Statements: FOR – TO –
(STEP) – NEXT

Advertising