Operator :: Foundation
Send operator (binary): sends a message to the object self.
::<Message>[( <Arguments,...> )]
The send operator :: is an abbreviated way of writing self:. It is used to send messages only to the object self. Otherwise it is identical to the normal send operator (:) (see the send operator, :).
The operator :: can only be used within the source code for methods and it is resolved by the Xbase++ compiler.
The variable self implicitly exists within the source code of all methods as a LOCAL variable. It always references the object which is currently executing the method.
// This example implements a simple class whose
// functionality corresponds with the command @...SAY. Within the
// source code for methods the send operator :: is used
// instead of self:
CLASS Label
EXPORTED: // globally visible
VAR nRow, nCol, cLabel, cColor
METHOD init, Show
ENDCLASS
//
// initialize object with default values when no
// arguments are passed to Label():new()
//
METHOD Label:init( nRow, nCol, cLabel, cColor )
::nRow := IIf( nRow == NIL, Row(), nRow )
::nCol := IIf( nCol == NIL, Col(), nCol )
::cLabel := IIf( cLabel==NIL, "" , cLabel )
::cColor := IIf( cColor==NIL, SetColor(), cColor )
RETURN self
//
// show label
//
METHOD Label:Show
@ ::nRow, ::nCol SAY ::cLabel COLOR ::cColor
RETURN self
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.