user manual
144
Chapter 8
Function
Result
Description
locchar(CHAR, N, STRING)
Integer
Used to identify the location of characters
in symbolic fields. The function searches
the string STRING for the character CHAR,
starting the search at the Nth character
of STRING. This functio n retu rns a value
indicating the location (starting at N) w here
the character is found. If the character is not
found, this function returns a value of 0. If
the function has an invalid offset (N) (for
example, an offset that is b eyond the length
of the s t ring), this function returns $null$.
For ex ample, locchar(`n`, 2, web_page)
searches th e field called web_page for the `n`
character begin ning at the second character
in the field v al ue.
Note: Be sure to use single backquot es to
encapsulate th e sp eci fied character.
locchar_back(CHAR, N, STRING)
Integer
Similar to locchar, except that the search is
performed backward starting from the Nth
character. F or example, locchar_back(`n`,
9, web_page) searches the field web_page
starting from t he ninth character and mo ving
backward toward the start of the string.
If the function has an invalid offset (for
example, an offset that is b eyond the length
of the string), this function returns $null$.
Ideally, you should use locchar_back in
conjunction with the function length(<field>)
to dynamically us e the length of the
current value of the field . For example,
locchar_back(`n`, (length(web_page)),
web_page).
lowertoupper(CHAR)
lowertoupper (STRING)
CHAR or
String
Input can be either a string or character,
which is used in this function t o return
a new item of t he same type, wit h any
lowercase characters converted to their
uppercase equivalents. For example,
lowertoupper(`a`), lowertoupper(“My
string”), and lowertoupper(field_name(2))
are all valid expressions.
matches
Boolean
Returns true if a string matches a specified
pattern. The pattern must b e a string literal;
it cannot be a field name containing a pattern.
A question mark (?) can be inclu ded in the
pattern to match exactl y one character; an
asterisk (*) matches zero o r more characters.
To match a literal question mark or asterisk
(rather than using these as wi l dcards), a
backslash (\) can be used as an escape
character.
replace(SUBSTRING, NEWSUBSTRING,
STRING)
String
Within the specified STRING, replace
all instances of SUBSTRING with
NEWSUBSTRING.
replicate(COUNT, STRING)
String
Returns a string that consists of the original
string copied t he specified number of t i mes.