Let
Function
To assign a value to a variable.
Syntax
[Let] variable = formula
Guaranteed entry
- Variable
- Designate a variable name to assign.
- Formula
- Designate a value to be assigned to the specified variable.
Description
A right-hand value is assigned to left-hand variable.
The right-hand value is automatically converted (casted) into left-hand variable data type and then assigned to the variable. An error occurs in case of data type that cannot be automatically converted (casted).
"Let" is optional.
Attention
-
Example
'!TITLE "Assignment of Value to Variable"
' Assign the sum of aaa and bbb to aaa
Sub Sample_Let
Dim aaa As Integer
Dim bbb As Integer
aaa = 1
bbb = 2
' Assign the sum of aaa and bbb to aaa
Let aaa = aaa + bbb
' Display "3" on the message output window
PrintDbg aaa
End Sub

