next up previous
Next: CHR_TRCHR - Translate the specified characters in a string
Up: Routine Descriptions
Previous: CHR_TERM - Terminate a string by padding out with blanks

CHR_TOCHR  -  Skip to the next specified character in a string

Description:
Increment a character pointer, IPOSN, either forward or backward through a string, until the character pointed to is one of a specified set of characters. The direction of the search is given by the argument FORWD. If no such character position exists (i.e. none of the remaining characters in the string are members of the specified set), the pointer is returned set to one more than the length of the string if the search is in the forward direction, or zero if the search is in the reverse direction. If the initial value of IPOSN does not point at one of the characters in the string, then the routine will return without action.

Invocation:
CALL CHR_TOCHR( CHARS, STRING, FORWD, IPOSN )

Arguments:
CHARS = CHARACTER ( ) (Given)
A string consisting of the set of characters to be searched for.
STRING = CHARACTER ( ) (Given)
The string to be searched.
FORWD = LOGICAL (Given)
The search direction: if .TRUE. then proceed through the string in a forward direction, otherwise work backwards through the string.
IPOSN = INTEGER (Given and Returned)
The character pointer.



next up previous
Next: CHR_TRCHR - Translate the specified characters in a string
Up: Routine Descriptions
Previous: CHR_TERM - Terminate a string by padding out with blanks



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