2 or, Logical or – Metrohm viva 1.0 (process analysis) User Manual

Page 53

Advertising
background image

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

2 General program functions

viva 1.0 (for Process analysis)

■■■■■■■■

41

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

1

0

1

0

0

0

Examples

Operand1

Operand2

Result

Example

Remark

Operands of the same type:

Number

Number

Number

5 OR 4 --> 1

4 OR 0 --> 1

Numbers greater than 1 are automati-
cally interpreted as 1 (true)

Text

Text

Number

"Metrohm" OR "AG" --> 1

"" OR "Metrohm" --> 1

"" OR "" --> 0

An empty character string ("") is inter-
preted as 0 (false), everything else as 1
(true). The first operation therefore cor-
responds to 1 OR 1 --> 1

Time

Time

Number

Time(1999;10;07) OR
Time(1964;02;03) --> 1

Time(): see Time(Date)

Operands of a different type: The operand which does not correspond to the result type is converted to the rele-
vant result type before the operation.

Number

Text

Number

1.2 OR "1.2" --> 1

0 OR "" --> 1

Before the operation, the operand of
the Number type is converted to the
Text type, as a conversion from Text to
Number is not useful. During the sec-
ond operation, the 0 is therefore con-
verted 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" OR 1.2 --> 1

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

Advertising