Operator_Negate
From Xojo Documentation
Global Method
Operator_Negate() As Type
Supported for all project types and targets.
Supported for all project types and targets.
Used to overload the - operator when used for negation, providing custom functionality.
Notes
Create an Operator_Negate function in a class to specify the functionality of the - operator for that class.
In the function, the definition of negation is given for the Self instance only. No parameters are passed.
Sample Code
In this example, the negation of the Vector class (see Operator_Add), a class with two Integer properties, x and y, is defined as the negative of the square length of the vector.
See Also
- operator.