TIP: Click on subject to list as thread! ANSI
echo: qedit
to: WALLY BROWN
from: GEORGE DE BRUIN
date: 1995-05-22 17:14:00
subject: Blocking separate lines?

 From | WALLY BROWN
/---------------------------------------
> for example, if I want to block and move lines 1, 4 and 6 and
> leave the rest there, is there any way of doing this with one
> command?
\---------------------------------------
   To | ALL
Hello Wally,
Not one command directly, however there are a couple of ways to
accomplish this task.  The first is a "hunt and gather" type
procedure...  Given your example:
    - Goto line 1 and mark the line (by pressing Alt L twice).
    - Goto line 4 and do a move block, then a markline (once).  This
      should expand the block so the two lines are marked.
    - Goto line 6, and repeat last sequence (move block / mark line)
    - Goto final destination and do a move block.
The other way to do this is to use a Scratch Buffer to store the lines
that you want to move, and then paste them in their final destination.
The following macros could be used for something like this:
* Paste
*
grey*   SetScreenOff  * turn OFF screen updating
    GetScrBuff   * paste text from scratch buff
    "_MY_CLIP_" Return  * specify our scratch buff
    UnMarkBlock   * remove this line to leave block marked
*
* Empty
*
^del   UnMarkBlock   * Make sure there isn't a block
    EditFile "Nul"      * Edit a temporary file
    Return    *
    MarkColumn   * Mark Column
    CursorRight   * Move one character
    MarkColumn   * Close block
    StoreScrBuff  * Store it in Scratch Buffer
    "_MY_CLIP_" Return  * specify our scratch buff
    UnMarkBlock   * UnMark The Block
    Quit    * Quit the temporary file
*
* Copy
*
grey+   SetScreenOff  * turn OFF screen updating
    AppendScrBuff  * attempt to append to scratch buff
    Jump mark   * if AppendScrBuff fails, jump to mark
    "_MY_CLIP_" Return  * else tell it which scratch buff to us
    UnMarkBlock   * unmark the block
    MacroQuit   * and quit
  mark: UnMarkBlock   * make sure there is no block marked
    MarkLine   * mark the current line
    AppendScrBuff  * append to scratch buff
    MacroQuitFalse  * quit if failed
    "_MY_CLIP_" Return  * specify our scratch buff
    UnMarkBlock   * unmark the block
    CursorDown   * and cursor down to next line
*
* Cut
*
grey-   SetScreenOff  * turn OFF screen updating
    AppendScrBuff  * attempt to append to scratch buff
    Jump mark   * if AppendScrBuff fails, jump to mark
    "_MY_CLIP_" Return  * else tell it which scratch buff to us
    DeleteBlock   * delete the block
    MacroQuit   * and quit
  mark: UnMarkBlock   * make sure there is no block marked
    MarkLine   * mark the current line
    AppendScrBuff  * append to scratch buff
    MacroQuitFalse  * quit if failed
    "_MY_CLIP_" Return  * specify our scratch buff
    DeleteBlock   * delete block, cursor now on next line
These macros will allow you to copy or cut individual lines into a
scratch buffer, and then paste them where you want to.
Be forewarned...  The macro that empties the buffer will actually leave
a blank line in it... There is no way around this that I can find
(without upgrading to a newer version...)
                           George J. De Bruin
                       SemWare Technical Support
 -- SPEED 2.0h #10: TSE Jr, MEM-RES, OS/2 & The SemWare Editor Professional
--- FidoPCB v1.4 [ff151/a]
---------------
* Origin: SemWare Support BBS * 404-641-8968 * (1:133/314)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.