' This example shows several cases of assignment.
' Wherever the keyword Let appears, it can be omitted
' without effect.
Dim a As Integer, b As Integer, c As Integer
Let a% = 2
Let b% = a%
Print b% ' Output: 2
Let c% = b% + 1
Print c% ' Output: 3
' Assign the value of b to an array element.
Dim devArray(3)
Let devArray(1) = b%
Print devArray(1) ' Output: 2
' Assign the value of c to a list element.
Dim devList List
Let devList("one") = c%
Print devList("one") ' Output: 3
' For an instance of a user-defined data type,
' assign the value of c - a to a member variable.
Type DevType
num As Integer
End Type
Dim inst As DevType
Let inst.num% = c% - a%
Print inst.num% ' Output: 1
' For an instance of a user-defined class,
' assign the value of a + b to a member variable.
Class DevClass
Public num% As Integer
End Class
Set devObj = New DevClass
Let devObj.num% = a% + b%
Print devObj.num% ' Output: 4