LET (Statement)


Assign a value to a given variable.


[LET] <variablename> = <arithmetic expression>


This statement assigns the value of <arithmetic expression> on the right-hand side to the variable specified by <variablename> on the left-hand side.
[LET] can be omitted.
Basically, the data type of <variablename> and that of <arithmetic expression> must correspond. If not, this statement converts the data type with the following rules.
  • The data type of the assigned value is converted to that of <variablename>.
    In the type conversion from real to integer, the fractional part is rounded off.
    In the type conversion from double-precision variable of type real to single-precision one, the value is rounded to 7 significant digits.
  • Calculations are performed based on the type with the higher precision.


6-/4-axis
DEFINT li1, li2
LET li1 = li2 + 1
'Assign the value of (li2 + 1) to li1
li1 = li2 + 1
'Assign the value of (li2 + 1) to li1 (same as above)

6-axis
DEFPOS lp1, lp2
DEFJNT lj1, lj2
lp1, = lp2 + (10, 10, 10, 0, 0, 0)
'Assign the value of (lp2 + (10,10,10,0,0,0)) to lp1
lj1, = lj2 + (10, 20, 30, 40, 0, 0)
'Assign the value of (lj2 + (10,20,30,40,0,0)) to lj1

4-axis
DEFPOS lp1, lp2
DEFJNT lj1, lj2
lp1, = lp2 + (10, 10, 10, 20)
'Assign the value of (lp2 + (10, 10, 10, 20) ) to lp1
lj1, = lj2 + (10, 20, 30, 40)
'Assign the value of (lj2 + (10, 20, 30, 40) ) to lj1


Top