faqts : Computers : Programming : Languages : Tse : Block

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

Entry

TSE: Block: Convert: How to convert a column block to a line block?

Oct 28th, 2006 08:15
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 28 October 2020 - 05:12 pm --------------------
TSE: Block: Convert: How to convert a column block to a line block?
===
Pseudo code:
--- cut here: begin --------------------------------------------------
Mark a column block
Get the first and last line number of the rows in that block
Mark a line block between that first and last row
--- cut here: end ----------------------------------------------------
===
--- cut here: begin --------------------------------------------------
 PROC Main()
  MarkLine( Query( BlockBegLine ), Query( BlockEndLine ) )
 END
--- cut here: end ----------------------------------------------------
===
As a function
--- cut here: begin --------------------------------------------------
 INTEGER PROC FNBlockGetLineNumberFirstI()
  RETURN( Query( BlockBegLine ) )
 END
 INTEGER PROC FNBlockGetLineNumberLastI()
  RETURN( Query( BlockEndLine ) )
 END
 INTEGER PROC FNBlockConvertColumnToLineB()
  IF NOT IsBlockMarked()
   Warn( "Please mark a block first" )
   RETURN( FALSE )
  ENDIF
  RETURN( MarkLine( FNBlockGetLineNumberFirstI(), 
FNBlockGetLineNumberLastI() ) <> 0 )
 END
 PROC Main()
  IF NOT FNBlockConvertColumnToLineB()
   Warn( "convert marked (column) block to line block not successful" )
  ENDIF
 END
 <F12> Main()
--- cut here: end ----------------------------------------------------
===
Tested successfully on
Microsoft Windows XP Professional (service pack 2),
running
TSE 4.x
===
Internet: see also:
---
TSE: Block: Link: Can you give an overview of links?
http://www.faqts.com/knowledge_base/view.phtml/aid/42860/fid/898
----------------------------------------------------------------------