Basic programming guide – Remote Processing BASIC for the CX-10 Modbus User Manual

Page 26

Advertising
background image

BASIC PROGRAMMING GUIDE

2-17

END

Syntax:

END

Function:

Terminates program execution and returns to command mode.

Mode:

Run

Use:

65000 END

DESCRIPTION

The END instruction terminates Basic program execution. If no END instruction is used at the end of a
program, the last instruction automatically terminates the program. Use END after the body of your program
and prior to any subroutines.

Without an END after the main body of your Basic program and prior to any subroutine program lines,
BASIC-52 will attempt to execute any subroutines at the end of your program as if they were a continuation
of the main program. This will generate a C-STACK error whenever a RETURN is encountered.

RELATED

CONT, STOP, GOSUB, ON-GOSUB

ERROR

CAN'T CONTINUE The CONT instruction cannot follow an END instruction.

EXAMPLE

10

GOSUB 100

20

END

100

PRINT PI

110

RETURN

>run

3.1415926

If you remove line 20, a C-Stack error is returned.

Advertising