Syntax, Example – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 112

Advertising
background image

Publication 1746-RM001A-US-P

8-16 Execution Control and Interrupt Support Functions

You can push more than one expression onto the argument stack using a single
PUSH statement with multiple expressions ([expr], [expr],.[expr]). Each expression
must be followed by a comma. The last value PUSHed onto the argument stack is
the last expression [expr] encountered in the push statement.

Syntax

PUSH [expr], [expr],.[expr]

Example

>1

REM EXAMPLE PROGRAM

>10 A = 10

>20 C = 20

>30 PRINT “A = ”,A,“ AND C = ” C

>40 PUSH A,C

>50 POP A,C

>60 PRINT “A = ”,A,“ AND C = ”,C

>70 END

READY

>RUN

A =

10

AND C =

20

A =

20

AND C =

10

READY

>

>NEW

>1

REM EXAMPLE PROGRAM

>10 PUSH 0

>20 CALL 14

>30 POP W

>40 PRINT W

>50 END

READY

>RUN

0

READY

>

IMPORTANT

The argument stack can hold up to 33 floating-point numbers
before overflowing.

Advertising