Metrohm tiamo 1.3 Manual User Manual
Page 79
Formula editor
53
Examples
TextPosition("Citric acid";"acidic")
= 9, from the index number 9 the word
"
acidic
" occurs in the text
TextPosition("Citric acid";"Acidic") = invalid
, the word "
Acidic
" (with a capital
letter) does not occur in the text
TextPosition("Citric acid";"salt") = invalid
, the word "
salt
" does not occur in
the text
TextPosition(Time(2004;05;05);"5") = 7
TextPosition(3362.14;"6") = 3
TextPosition('MV.ID2';"Carbonate")
= index, in which the word part "
Carbon-
ate
" first starts in ID2
SubText
Syntax
y = SubText(Text ; Position ; Length)
Returns that text part from
Text
that starts at the index
Position
and has the
length
Length
.
Parameter
Text
The parameter can either be entered directly as text or as a Variable of
the type
Text
. If the parameter does not correspond to the expected type
then it will be automatically converted to it (see Type conversion "Number-
ToText" or "TimeToText"). If this type conversion is not possible then the re-
sult of this operation will be returned as "
invalid
".
Position
The numbering of the
Position
starts at 1. The parameter can either be en-
tered directly as a number or as a Variable of the type
Number
. If the pa-
rameter does not correspond to the expected type then it will be automati-
cally converted to it (see Type conversion "TextToNumber"). If the type con-
version is not possible or if the position does not exist then the result of this
operation will be returned as "
invalid
".
Length
The parameter can either be entered directly as number or as a Variable
of the type
Number
. If the parameter does not correspond to the expected
type then it will be automatically converted to it (see Type conversion
"TextToNumber"). If the type conversion is not possible or if the length given
here is longer than the length of the subtext then "
invalid
" will be returned
Examples
SubText("Citric acid";9;5) = acidic
SubText("Citric acid";9;6) = invalid
, from the position 9 only five characters
are present
SubText('MV.ID2';1;3)
= the first three characters of the identification 2