home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
utilities
/
editors
/
ced-programs
/
markright.ced
< prev
next >
Wrap
Text File
|
1994-06-23
|
2KB
|
82 lines
/*
* Mark.ced «
* «
* Marks current block/line with "«" on the right margin. «
* «
* Author: Stefan Winterstein (winter@cs.uni-sb.de) «
* Status: Public Domain «
*
*/
defmarker = '«'
LF = '0A'X
options results /* Allow CygnusEd to pass status variables */
address 'rexx_ced' /* Tell ARexx to talk to CygnusEd */
status 9
word_wrap_on = result
if word_wrap_on then 'word wrap' /* turn Word-Wrap off */
status 47 /* get current line number */
start = result
status 69 /* get start of block */
end = result
if end = -1 then do /* No block marked */
end = start+1
end
else do
'mark block' /* turn bock marking off */
end
marker = defmarker
/*
* 'getstring' '"'defmarker'"' '"Mark block with:"'
* if (result = "") then exit
* else if (result = "RESULT") then marker = defmarker
* else marker = result
*/
if start > end then do /* swap start with end */
t = start
start = end
end = t
end
'jump to line' start+1 /* goto start of block */
/*
* status 14 /* get right margin */
* maxwidth = result
*/
maxwidth = 79
do line = start while line < end
status 59 /* get length of line (including LF) */
maxwidth = max(maxwidth, result+1)
'down'
end
'jump to line' start+1 /* goto start of block */
'beg of line'
do line = start while line < end
'end of line'
status 46 /* get column number */
column = result+1
'text' copies(' ', abs(maxwidth - column)+1) /* fill in spaces */
'text' marker
'down'
end
'jump to line' start+1
'beg of line'
if word_wrap_on then 'word wrap' /* turn Word-Wrap on again */
exit