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: Line: Wrap: How to wrap 1 line, with separators in between, back to the original block?

Nov 12th, 2006 09:36
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 12 November 2020 - 04:38 pm -------------------
TSE: Block: Wrap: How to wrap a block to 1 line, with separator 
between the lines?
Method: Replace end of lines in the block by the separators (put at the
        begin of each line), store the current right margin, set the
        right margin to another (maximum line length) value, wrap the
        block, restore the right margin
===
--- cut here: begin --------------------------------------------------
FORWARD PROC Main()
FORWARD PROC PROCLineChange_SeparatorWrapToBlock1Simple( STRING s1 )
// --- MAIN --- //
PROC Main()
 PROCLineChange_SeparatorWrapToBlock1Simple( "\#\#\#" )
END
<F12> Main()
// --- LIBRARY --- //
// library: line: change: separator: wrap: to: block1 
(filenamemacro=chanbltl.s) [kn, ri, su, 12-11-2020 03:35:10]
PROC PROCLineChange_SeparatorWrapToBlock1Simple( STRING s )
 IF NOT IsBlockInCurrFile()
  Warn( "please mark a block" )
 ENDIF
 PushPosition()
 LReplace( s, "", "glnx1")
 LReplace( s, "\n", "glnx")
 PopPosition()
END
--- cut here: end ----------------------------------------------------
===
Internet: see also:
---
----------------------------------------------------------------------