Copying a column block to lines

0 views
Skip to first unread message

Larry

unread,
Nov 3, 2009, 8:03:55 PM11/3/09
to GoogleSemWare TSE, TsePro
Having nothing better to do, I sang a little song and did a little jig...
 
Sometimes, you want to copy or move a column block to a location where
you want it to push the below-cursor lines down, like copying a marked line
block. What usually happens is that the column block just pushes the text
below and to the right of the cursor to the right edge of the column block
rather than pushing the lines down the file.
 
This macro will make line-space below the cursor line and copy the marked
column block to the new empty lines.
 
Now, is there an easier or better way to do this?
 
// --- source starts here
// copy a column block like a line block
 
<ctrlshift x><c> execmacro("jigcopycolaslines")
 
proc main()
 
integer i=0
integer j=0
 
if isblockmarked()==_column_
  i=query(blockendline)-query(blockbegline)+1
  pushposition()
  for j=1 to i
    addline()
  endfor
  popposition()
  copyblock()
endif
 
end
// --- source ends here

S.E. Mitchell

unread,
Nov 7, 2009, 9:19:39 AM11/7/09
to sem...@googlegroups.com, TsePro
Cool - this is something I frequently have to do manually.

I don't know if this is easier or better, but it is different - and
only slightly tested:

public proc copy_col_as_lines()
if isBlockMarked() == _COLUMN_
MarkLine(Query(BlockBegLine), Query(BlockEndLine))
endif
CopyBlock()
end

Thanks for sharing your macro!

Heijer, Rob den

unread,
Nov 9, 2009, 5:02:41 AM11/9/09
to sem...@googlegroups.com
This looks different.
The first macro clears some space for the column block to be copied, then copies the column block only
The second one extends the column block to a line block, then copies the whole line-block - including any text right or left of the marked column...

cheers,
Rob.


This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message
in error, please notify the sender immediately and delete all copies of this message.

S.E. Mitchell

unread,
Nov 10, 2009, 4:39:05 PM11/10/09
to sem...@googlegroups.com
Yikes! You are right - the macros behave differently.
Sorry about that!
Reply all
Reply to author
Forward
0 new messages