home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / text / textra / scripts / deltoend.textra < prev    next >
Text File  |  1995-02-27  |  1KB  |  44 lines

  1.     /******************************************************************
  2.      *   TEXTRA AREXX script -- Mike Haas, 1991, All Rights Reserved.  *
  3.      * Freely distributable ONLY as a component of the TEXTRA package. *
  4.      * This banner may not be removed or altered (improvements to the  *
  5.      *    actual program welcome).  Please document and send to me.    *
  6.      *        !!! PLACE THIS FILE IN YOUR REXX: DIRECTORY !!!          *
  7.      ******************************************************************/
  8.  
  9. /* Usage:  DelToEnd
  10.  *
  11.  * This script accepts no parameters, and simply deletes to the end of the
  12.  * current line from the current cursor position.  If a select range exists,
  13.  * deletion starts at the beginning of the selection.
  14.  *
  15.  * If the select is greater than one line, it presents a notification
  16.  * requester.
  17.  *
  18.  */
  19.  
  20. options results
  21.  
  22. get cursor position
  23.  
  24. if (result ~= SELECT) then do
  25.     parse var result xstart' 'ystart
  26. end
  27. else do
  28.     get select position
  29.     parse var result xstart' 'ystart' 'xend' 'yend
  30.     if (ystart ~= yend) then
  31.        if ((xend ~= 0) | ((yend-ystart) > 1)) then do
  32.           notify '"Only 1 selected line allowed for DelToEnd script."'
  33.           exit
  34.        end
  35. end
  36.  
  37. eol
  38. get cursor position
  39. parse var result xeol' 'yeol
  40. if (xeol ~= xstart) then do
  41.    selectto xstart ystart
  42.    backspace
  43. end
  44.