home *** CD-ROM | disk | FTP | other *** search
- ; Macro for XLisp - parenthesis searcher
-
- store-procedure search-par
- !if &equal $curchar 40
- set %actchar 40
- set %findchar 41
- set %direction 1
- !else
- !if &equal $curchar 41
- set %actchar 41
- set %findchar 40
- set %direction 0
- !else
- print $curchar
- !return
- !endif
- !endif
- set %actctr 0 ;counter of the actual characters
- !while 1
- !if %direction
- !force 1 forward-character
- !if ¬ $status
- print "No matching )"
- !return
- !endif
- !else
- !force 1 backward-character
- !if ¬ $status
- print "No matching ("
- !return
- !endif
- !endif
- !if &equal $curchar %findchar
- !if &equal %actctr 0
- !return
- !else
- set %actctr &sub %actctr 1
- !endif
- !else
- !if &equal $curchar %actchar
- set %actctr &add %actctr 1
- !endif
- !endif
- !endwhile
- !endm
-
- macro-to-key search-par A-Z
-
-