Equals symbol (=)

The Equals symbol can be used to determine whether two numeric values are the same.

Syntax

number_1 = number_2

Number_1 and number_2 must be numeric values. (To compare string values, use STRCOMP.)

Return value

If number_1 and number_2 are equal, this command returns the number 1.

If number_1 and number_2 are not equal, this command returns the number 0.

Notes

The Equals symbol is often used with an IF command, as shown in the examples below.

To perform a comparison that is equivalent to "NOT EQUAL", use the Equals symbol with an IF command. The command for the action to take if the values are not equal should be placed in the False Part parameter of the IF command (after the second comma).

The Equals symbol can also be used to set the value of a numeric variable or a string variable. For more information, see NVAR, SVAR, MYNVAR, MYSVAR, MYNARR or MYSARR.

Examples

IF ([A1] = 0), (MESSAGE "The number is zero."), GOTO [B3]

If cell [A1] equals 0, display the message. If [A1] does not equal 0, go to cell [B3].

IF ([B1] = 0), "", (MESSAGE "The number is not zero.")

This example performs a "NOT EQUAL" comparison.

If cell [B1] does not equal 0, the message is displayed.