home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************
- * TEXTRA AREXX script -- Mike Haas, 1991, All Rights Reserved. *
- * Freely distributable ONLY as a component of the TEXTRA package. *
- * This banner may not be removed or altered (improvements to the *
- * actual program welcome). Please document and send to me. *
- * !!! PLACE THIS FILE IN YOUR REXX: DIRECTORY !!! *
- *******************************************************************/
-
- /*
- ** routine to delete a comment box from around the selected text
- ** adapted from Mike Haas's 'slide' routine
- */
-
- OPTIONS results
-
- 'get' "select position" /* get the select boundary, if any */
-
- if (result == "NO SELECT") then /* is nothing selected? */
- exit /* Then just go back */
-
- parse var result startx ' ' starty ' ' endx ' ' endy
- LinesSelected = (endy - starty)
-
- /* if only the 'eol' of the previous line is selected
- (nothing on this line is actually included, i.e. x==0),
- then don't include it.
- */
- if (endx > 0) then
- LinesSelected = LinesSelected + 1
- else
- endy = endy - 1
-
- /*
- ** someday, this'll be a real careful, checking routine. But for the nonce,
- ** we'll just assume that the line at the beginning of the selection region
- ** is the "/*****..." line, while the line at the end is the "...*****/"
- ** line
- */
-
- 'unselect'
- 'gotoxy' 0 endy
- 'selectto' 0 endy+1
- 'del'
- 'gotoxy' 0 starty
- 'selectto' 0 starty+1
- 'del'
-
- do LinesSelected - 2
- /* At this point we are in column zero of a line to have its '*'s
- ** removed.
- */
- 'del'; 'del' /* The '* ' at the beginning */
- 'down' 1
- 'left' 1
- 'backspace' /* The '*' at the end of the line */
- do forever
- 'left' 1
- 'get cursor char'
- if (result ~= ' ') then leave
- 'del'
- end
- 'right' 2
- end
-
- exit
-
-