Functions - text – Metrohm tiamo 1.0 Manual User Manual
Page 74

50
General program functions
Functions - Text
TextPosition
Syntax
y = TextPosition(Text ; Sample text)
Returns the Index that indicates at which position the
Sample text
first oc-
curs in the
Text
. The numbering of the index starts at 1!
Parameter
Text
The parameter can either be entered directly or as a Variable of the type
Text
,
Number
or
Date/Time
.
Sample text
The parameter can either be entered directly or as a Variable of the type
Text
,
Number
or
Date/Time
. If the types of the two parameters are not identi-
cal then the type
Sample text
will always be converted to
Text
(see Func-
tions - type conversion). If the
Sample text
is not contained in the
Text
then
"
invalid
" will be returned.
Note
Entries of the type
Number
are always given with one decimal place.
Example:
TextPosition("12345";3) = invalid
, as before the operation the 3 is con-
verted to 3.0 and this is not contained in the text.
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
".