Indicates the assignment operator when overloading
Operator = (Assignment)
Syntax
Usage
lhs = rhs
Parameters
typename
lhs
The variable to assign to.
rhs
The value to assign.
Description
Let is used to overload the
Operator = (Assignment) operator and to distinguish it from the comparison operator
Operator = (Equal).
lhs = rhs will assign the
rhs to
lhs by invoking the
Let operator procedure defined int
typename.
Example
Type T
x As Integer
y As Integer
Declare Operator Let( ByRef rhs As T )
End Type
Operator T.let( ByRef rhs As T )
x = rhs.x
y = rhs.y
End Operator
Dim a As T = ( 5, 7 )
Dim b As T
'' Do the assignment invoking the LET
'' operator procedure
b = a
Print "a.x = "; a.x
Print "a.y = "; a.y
Print
Print "b.x = "; b.x
Print "b.y = "; b.y
Output:
a.x = 5
a.y = 7
b.x = 5
b.y = 7
Dialect Differences
Differences from QB
See also