Examples – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 82

Advertising
background image

Publication 1746-RM001A-US-P

6-6 Assignment Functions

Examples

>1

REM EXAMPLE PROGRAM

>10 LET A = 10*SIN(C)/100

>1

REM EXAMPLE PROGRAM

>10 LET A = A +1

When LET is omitted the LET statement is called an IMPLIED LET. We use the
word LET to refer to both the LET statement and the IMPLIED LET statement.

Also use the LET statement to assign string variables:

LET $(1)=“THIS IS A STRING”

or

LET $(2)=$(1)

Before you can assign strings you must execute the STRING [expr], [expr]
statement or else a memory allocation error occurs that causes the module to enter
the Command mode.

NOTE

The - sign used in the LET statement is not an equality operator.
It is a replacement operator. The statement should be read A is
replaced by A plus one. The word LET is always optional
(example:

LET A = 2

is the same as

A = 2

).

Advertising