Revision [12400]

This is an old revision of KeyPgOpLet made by JeffMarshall on 2008-01-18 14:21:39.

 

Operator Let (Assign)


Indicates the assignment operator when overloading KeyPgOpAssignment Operator = (Assignement

Syntax:
Usage:
lhs = rhs

Parameters:
typename
lhs
The variable to assign to.
rhs
The value to assign.

Description:
Let is used to overload the KeyPgOpAssignment Operator = (Assignment) operator and to distinguish it from the comparison operator KeyPgOpEqual Operator = (Equal).
lhs = rhs will assign the rhs to lhs by invoking the Let operator procedure defined int typename.

Examples:
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 assinment 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:
Back to Assignment Operators
Back to Operators
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode