home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / text / textra / scripts / deltostart.textra < prev    next >
Text File  |  1995-02-27  |  1KB  |  42 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:  DelToStart
  10.  *
  11.  * This script accepts no parameters, and simply deletes to the start of the
  12.  * current line from the current cursor position.  If a select range exists,
  13.  * deletion goes the end 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 xend' 'yend
  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 DelToStart script."'
  33.           exit
  34.        end
  35. end
  36.  
  37. if (xend ~= 0) then do
  38.    bol
  39.    selectto xend yend
  40.    backspace
  41. end
  42.