Rockwell-automation 1771-DB BASIC MODULE Instrukcja Użytkownika Strona 171

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
Przeglądanie stron 170
Chapter
Statements
1
1
11 -19
Use the LET statement to assign a variable to the value of an expression.
The = sign used in the LET statement is not an equality operator. It is a
replacement operator. The statement should be read var is replaced expr.
The word LET is always optional (ex.
LET A = 2
is the same as A
= 2
).
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 (page 11 -37) or else a memory allocation error occurs that
causes the module to enter the Command mode.
Syntax
LET
var
=
expr
Example
>
1 REM EXAMPLE PROGRAM
>
10 LET A = 10*SIN(C)/100
>
20 LET B = B +1
LET
Przeglądanie stron 170
1 2 ... 166 167 168 169 170 171 172 173 174 175 176 ... 393 394

Komentarze do niniejszej Instrukcji

Brak uwag