beautypg.com

Miscellaneous functions – Metrohm tiamo 1.0 Manual User Manual

Page 76

background image

52

General program functions

Miscellaneous functions

Case

Syntax

y = Case(condition ; Value_true ; Value_false)

y = Case(condition ; Value_true ; Value_false ; Value_error)

Returns

Value_true

if the condition is true. Otherwise

Value_false

will be re-

turned. If an error occurs in the condition (Result "

invalid

") then

Value_error

will be returned.

Parameters

Condition

Number

Any Variable (type

numb

er) can be entered here, or a Compare or logic op-

eration can be carried out whose operators are either adopted directly or

transferred as a Variable. This could be of the type

Text

,

Number

or

Date/Time

(

Time()

).


Value_true

If the Condition <> 0 then this parameter will be saved as the result of the
function.

This parameter can either be transferred directly or as a Variable and can
be of the type

Text

,

Number

or

Date/Time

(

Time()

). Complete Operations

can also be transferred here.


Value_false

If the Condition = 0 then this parameter will be saved as the result of the

function.
This parameter can either be transferred directly or as a Variable and can
be of the type

Text

,

Number

or

Date/Time

(

Time()

). Complete Operations

can also be transferred here.

Value_error

If the Condition = invalid then this parameter will be saved as the result of
the function.
This parameter can either be transferred directly or as a Variable and can
be of the type

Text

,

Number

or

Date/Time

(

Time()

). Complete Operations

can also be transferred here.

Examples

Case('MV.ID1' = "";"ID1 empty";"ID1 not empty")

= if in the Sequence win-

dow no entry has been made for ID1 then in the result the text "

ID1 empty

"

will appear, otherwise "

ID1 not empty

" will be saved.

Case( 'DET pH 1.EP{1}.VOL';'DET pH 1.EP{1}.VOL';0;0)

= if in the titration

DET

pH 1

an endpoint has been found for which the volume is not 0 (

Value_true

)

then this will be saved as the result. If EP1 is at 0 exactly then

0

will be re-

turned. If no endpoint has been found then

0

will also be saved as the result

of this function.

Case('RS.InterRes' > 5.5;"Intermediate result too high";'RS.InterRes' *
26.5;"error occurred")

= if the the result "

InterRes

" is larger than 5.5 then the

text "

Intermediate result too high

" will be written in the result, otherwise the

intermediate result will be multiplied by 26.5. If in the comparison

(

'RS.InterRes' > 5.5

) an error occurs then "

Error occurred

" will be saved as the

result of this operation.