Institut für Astronomie und AstrophysikAbteilung AstronomieSand 1, D-72076 Tübingen, Germany |
MATCHDELIM
Match open/close delimiters in a string.
text/strings
position = matchdelim( strn, [openpos])
strn -- a string containing an open in delimiter (e.g. '{') in which you want to find the matching closing delimiter (e.g. '}')
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 '}'
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.
- Any pair of (nonidentical) characters can be used as delimiters.
matchdelim('{one{two}}three') returns 9, the character just before 'three'.
$Id: matchdelim.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $ $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
$Name: Rel_2_1_2 $
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.
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]