next up previous
Next: CHR_FIWS - Find the start of the next word within a string
Up: Routine Descriptions
Previous: CHR_FIND - Find the next occurrence of given substring within a string

CHR_FIWE  -  Find the next end-of-word within a string

Description:
Find the next end-of-word, signified by the following character being a word delimiter (SPACE, TAB or COMMA). Note that the start of the next word is not found before looking for the next word delimiter so it is possible for IPOSN to remain unchanged and indeed to point to a word delimiter rather than a true end of a word. This routine is expected to be used in conjunction with CHR_FIWS.

Invocation:
CALL CHR_FIWE (STRING, IPOSN, STATUS)

Arguments:
STRING = CHARACTER ( ) (Given)
The string to be searched.
IPOSN = INTEGER (Given and Returned)
The given value is the character position within the string at which searching is to start. If IPOSN is less than 1, the search starts at position 1. The returned value is the character position preceding the next word delimiter. If IPOSN already points to a character preceding a delimiter, it is returned unchanged. If no delimiter is found, IPOSN is returned pointing to the end of the string, and STATUS is returned set.
STATUS = INTEGER (Given and Returned)
The status value: if this value is not SAI__OK on entry, the routine returns without action; if the next word delimiter is not found before the end of the string, STATUS is returned set to CHR__EOSNT. Note: The CHR__EOSNT symbolic constant is defined in the CHR_ERR include file.



next up previous
Next: CHR_FIWS - Find the start of the next word within a string
Up: Routine Descriptions
Previous: CHR_FIND - Find the next occurrence of given substring within a string



CHR Character Handling Routines
Starlink User Note 40
A C Charles
P C T Rees
A J Chipperfield
2 August 1995
E-mail:ussc@star.rl.ac.uk