This function is used to subsequently break a string into tokens.
Tokens separators are any number of spaces.
If just the string is provided, the function returns the position of
the first printable character;
If also ib is provided it saves the position of the first printable
character after position ib (or ib itself) in ib and return the
position of the last printable character before the first space after
ib. If ntok is specified instead of a single token, ntok are
returned. In case of last token hitten -1 is returned.
To divide a string follow the following scheme:
1. ib = tokenize(s)
2. ie = tokenize(s, ib)
3. tok1 = s(ib:ie)
4a. ib = ib+1
4b. ie = tokenize(s, ib)
5. tok2 = s(ib:ie)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=OMMP_STR_CHAR_MAX), | intent(in) | :: | s |
String to subdivide in token |
||
integer(kind=ip), | intent(inout), | optional | :: | ib |
Index where to start token research (input)/Index where token begins (output) |
|
integer(kind=ip), | intent(in), | optional | :: | ntok |
Number of token to be extracted |
Index where token ends.