Hitachi

JP1 Version 11 JP1/Script Description and Reference (For Windows Systems)


8.8.3 - operator (subtraction and negation) (find the difference between two numbers)

Purpose

Finds the difference between two numbers, or reverses the sign of a numerical expression.

Syntax 1
Result = Number1 - Number2
Syntax 2
-Number
Arguments
Result

Specify a variable for storing the difference between the two numbers.

Number

Write any numerical expression.

Number1

Write any numerical expression.

Number2

Write any numerical expression.

Description

In Syntax 1, the - operator subtracts Number2 from Number1 and returns the difference as the result.

In Syntax 2, the - operator is the unary negation operator and reverses the sign of an expression.

Expressions with Empty values are handled as zero.

Note

When Result and Number1 are the same variable, you can use the -= operator instead.

Example
' This code stores 2 in result1.
result1 = 7 - 5
JP1/Script version

Supported from JP1/Script 01-00.