beautypg.com

Subtext – Metrohm tiamo 1.1 Manual User Manual

Page 83

background image

Formula editor

55

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

".

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