<< Prev        Next >>

ID : 3791

- Operator

Function

To return the sign inversion, difference between numeric values, or difference between vector type data or joint type data.

Syntax

Sign inversion
- expression1

OR

Difference
expression2 - expression3

Guaranteed Entry

expression1
Designate data to invert the sign. Designate numeric data.
expression2
Designate numeric data or vector type data or joint type data.
expression3
Designate numeric data or vector type data or joint type data.

Return Value

Return data with inverted argument sign in case of single item, value difference in case of numeric values, or element value difference in case of vector type data or joint type data.

Description

Either of the following types of operation is performed depending on argument combination.

Sign inversion

If data exist only on right-hand side of the operator, data sign is inverted.

Designate numeric data for argument. Vector type data cannot be designated.

Difference between numeric values

If data exist on both sides of the operator and data are numeric, the difference is returned.

Difference is obtained depending on data type with higher priority.

Difference between vector type data elements

The difference between vector type data elements in case the data on both sides of the operator are vector type data are calculated and vector type data are returned.

Dim aaa As Vector, bbb As Vector
aaa = V(100, 200, 300)
bbb = V(10, 20, 30)
PrintDbg aaa - bbb
' V(90, 180, 270) is output
Difference between joint type data elements

The difference between joint type data elements in case the data on both sides of the operator are joint type data are calculated and joint type data are returned.

Dim ccc As Joint, ddd As Joint
ccc = J(110, 120, 130, 140, 150, 160, 170, 180)
ddd = J(100, 100, 100, 100, 100, 100, 100, 100)
PrintDbg aaa - bbb
' J(10, 20, 30, 40, 50, 60, 70, 80) is output.

Attention

- operation of string type data cannot be performed.

Example

-

ID : 3791

<< Prev        Next >>