beautypg.com

2 or, Logical or – Metrohm viva 1.0 Manual User Manual

Page 51

background image

■■■■■■■■■■■■■■■■■■■■■■

2 General program functions

viva 1.0

■■■■■■■■

39

Oper-
and1

Oper-
and2

Result

Example

Remark

Text

Text

Number

"Metrohm" AND "AG" --> 1

"" AND "AG" --> 0

An empty character string ("") is interpre-
ted as 0 (false), everything else as 1 (true).
The first operation therefore corresponds
to 1 AND 1 --> 1.

Time

Time

Number

Time(1999;10;07) AND
Time(1999;10;07) --> 1

Time(): see Time(Date)

Operands of a different type:

Number

Text

Number

1.2 AND "1.2" --> 1

0 AND "1" --> 1

0 AND "0" --> 1

0 AND "" --> 0

Before the operation, the operand of the
Number type is converted to the Text
type, as a conversion from Text to Num-
ber
is not useful. During the second oper-
ation, the 0 is therefore converted to "0",
which corresponds to the logical value 1
(true), as every character string that is not
empty is interpreted as 1.

Text

Number

Number

"Metrohm" AND 1.2 --> 1

The same rules apply here as for the previ-
ous operation.

Number

Time

Number

2.0 AND Time(1999;10;7) -->
1

0 AND Time(1999;10;07) --> 0

Before the operation, the operand of the
Date/Time type is converted to Number
and all dates since December 30, 1899
are interpreted as 1 (true).

Time

Number

Number

Time(1999;10;7) AND 2.5 -->
1

The same rules apply here as for the previ-
ous operation.

Text

Time

Number

"Metrohm" AND
Time(1999;10;7) --> 1

"" AND Time(1999;10;07) -->
0

Before the operation is carried out, the
operand of the Date/Time type is con-
verted to the Text type, and every non-
empty character string is interpreted as 1
(true).

Time

Text

Number

Time(1999;10;7) AND
"Metrohm" --> 1

The same rules apply here as for the previ-
ous operation.

2.3.4.3.2

OR

Dialog window: Formula editor

Operators/Functions

Syntax
Operand1 OR Operand2

The operands can be entered either directly or as a variable and can be of
the Text, Number or Date/Time type. The result type is always a num-
ber (1 = true, 0 = false). The following cases are possible:

Operand1

Operand2

Result

1

1

1

0

1

1