beautypg.com

Operators - compare – Metrohm tiamo 1.0 Manual User Manual

Page 58

background image

34

General program functions

Operators - Compare

Equal

Syntax

Operand1 = Operand2

The operands can either be entered directly or as a Variable and can be
of the type

Text

,

Number

or

Date/Time

. The result type is always a number (

1

= true,

0

= false).

Examples

Operand1 Operand2 Result

Example

Remarks

Operands of the same type:

Number Number Number

5 = 5 --> 1
4 = 5 --> 0

-

Text Text Number

"Metrohm" = "AG" --> 0

"aG" = "AG" --> 0

In a comparison between two text the

ASCII values (see ASCII table) of the char-
acter strings are compared. Note: upper
and lower case letters have different val-
ues!

Time Time Number

Time(1998;04;06) =
Time(1964;02;03) --> 0

Time()

: see function Time(Date)

Operands of different types:

Number Text

Number

1.2 = "1.2" --> 1
1.2 = "Metrohm" --> 0

Before the comparative operation the

Number

is converted to

Text

and then the

texts are compared according to the ASCII
table.

Text Number

Number

"Metrohm" = 1.2 --> 0

The same rules apply here as for the pre-
vious operation.

Number Time

Number

2.0 = Time(1999;10;07) -
-> 0

Before the comparative operation the

Date/Time

is converted to

Number

. When

the operation is carried out the exact value

obtained after this conversion is always
used, even when only a maximum of 5
decimal places can be shown (for details
please refer to Type conversion "TimeTo-

Number", Note).

Time Number

Number

Time(1999;10;7) = 2.0 --
> 0

The same rules apply here as for the pre-
vious operation.

Text Time Number

"Metrohm" =
Time(1999;10;07) --> 0

Before the operation an operand of type

Date/Time

is converted to

Text

(i.e.:

"1999-

10-07 00:00:00 UTC+2"

), then the texts are

compared according to the ASCII table.

Time Text Number

Time(1999;10;07) =
"Metrohm" --> 0

The same rules apply here as for the pre-
vious operation.