NAME:
MATCHDELIM
PURPOSE:
Match open/close delimiters in a string.
CATEGORY:
text/strings
CALLING SEQUENCE:
position = matchdelim( strn, [openpos])
INPUTS:
strn -- a string containing an open in
delimiter (e.g. '{') in which you
want to find the matching closing
delimiter (e.g. '}')
KEYWORD PARAMETERS:
OPEN_DELIM -- A single character containing the opening in
delimiter (e.g. '('). Default is '{'
CLOSE_DELIM -- A single character containing the closing in
delimiter (e.g. ')'). Default is '}'
OUTPUTS:
position -- returns the position in strn of the out
closing delimiter, -1 if no closing found.
openpos -- Set to a named variable to receive the out
position of the first opening delimiter.
Optional.
COMMON BLOCKS:
SIDE EFFECTS:
NOTES:
- Any pair of (nonidentical) characters can be used as
delimiters.
EXAMPLE:
matchdelim('{one{two}}three') returns 9, the character just
before 'three'.
MODIFICATION HISTORY:
$Id: matchdelim.pro 47 2006-05-09 09:13:01Z pinsard $
$Log: matchdelim.pro,v $
Revision 1.3 1996/06/14 20:00:27 mcraig
Updated Copyright info.
Revision 1.2 1996/05/09 00:22:17 mcraig
Removed restriction that open delim must be first char. Added argument
to allow for return of position of open delim.
Revision 1.1 1996/01/31 18:41:06 mcraig
Initial revision
RELEASE:
$Name: Rel_2_1_2 $
COPYRIGHT:
Copyright (C) 1996 The Regents of the University of California, All
Rights Reserved. Written by Matthew W. Craig.
See the file COPYRIGHT for restrictions on distrubting this code.
This code comes with absolutely NO warranty; see DISCLAIMER for details.