Ray Yates
: mivascript at, pcinet d0t com
09/10/2011 20:01 p.m.
09/10/2011 20:01 p.m.
Given this pipe delimited string: gettoken('a|b|c|d|e', '|', 3) returns "c" Where s.tm_mon is a system variable that contains the numeric month of the year (1 to 12) this function will return an abreviation of the current month from the space delimited string. gettoken('Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec,' ',s.tm_mon) Sometime it is usefull to know how many tokens are in a string. The GettokenCount() function below can be used to get than number.
<MvFUNCTION
NAME
="
GettokenCount
"
PARAMETERS
="
text_string, separator
"
STANDARDOUTPUTLEVEL
=""
>
<MvFUNCRETURN
VALUE
="
{ (len(l.text_string) - len(glosub(l.text_string, l.separator,''))) + 1 }
>"
</MvFUNCTION>