Data types and Operators

Operator :: Foundation

Send operator (binary): sends a message to the object self.

::<Message>[( <Arguments,...> )]
The send operator :: is used to send messages to the object referenced by the variable named self within the source code that implements the methods of the class.
<Message> is the name of a member variable to be accessed or the name of a method to be executed.
<Arguments,...> is a comma separated list of optional expressions which must be enclosed in parentheses. The values of the expressions are passed to the method executed by the message <Message>. When parentheses are not used a member variable is always accessed.

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.

The send operator (::)

// 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 
// 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.