User manual

DataSTORM
- 62 -
Fontware Limited. All rights reserved
.
Variable manipiulation functions
Currently DSM supports flowing functions for string manipulations. The Syntax of the case sensitive
named functions are:
LEFT(#StringVarible#, Length)
LEFT(#StringVarible#,#IntVariable#)
The functions are only interpreted, if
they are set directly in front of a
variable and there is a comma
directly after the variable followed by
the length number and the closing
parenthesis. The positive length
represents the amount of bytes to
be taken out of the provided
variable. The amount can be
represented by another variable.
RIGHT(#StringVarible#, Length)
RIGHT(#StringVarible#,
#IntVariable#)
In principal the same function, but
the amount of bytes are taken from
the right side of the evaluated string
LOWER(#StringVariable#)
Turns all ASCII characters from the
variable into lower case.
UPPER(#StringVariable#)
Turns all ASCII characters from the
variable into upper case.
STRPOS(#Variable#, #SearchVar#)
STRPOS(#Variable#, Text)
STRPOS(#Variable#, “ “)
Returns the first position minus 1 of
the first charater of the #SearchVar#
string found in the #Variable# string.
If the string could not be found then
function returns zero.
Leading blanks can only be
searched if the search text is
surrounded be double quotes.
Examples: The content of the
#Variable# is “Hello World”
STRPOS(#Variable#,” “) -> 5
STRPOS(#Variable#,”World“) -> 6
Assume content #SVar# is “World”
STRPOS(#Variable#, #SVar#) -> 6
Assume content #SVar# is “ ” (a
blank)
STRPOS(#Variable#, #SVar#) -> 0
Assume content #SVar# is “ World”
STRPOS(#Variable#,#SVar#) -> 6
Counter key Increments an integer variable by
default 1 or any other value
Note: Currently DSM dos not support combining several of these function like
UPPER(LEFT(#Variable#, 5)). In this case use two command lines:
Variable=MyTempVar:LEFT(#Variable#, 5)
Variable=MyTempVar:UPPER(#MyTempVar#)
Examples:
Get the actual year, most likely set in the section Global
Variable=ActualYear:RIGHT(#DATENUM#, 4)
#DATENUM# -> 5.2.2004
#ActualYear# -> 2004
Limit the Document name variable to 14 characters
Variable=PRINTDOCNAME:LEFT(#PRINTDOCNAME#, 14)
Before: Microsoft Word – TheDocumentname.doc