home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
editor
/
me
/
box.m
< prev
next >
Wrap
Text File
|
1994-01-31
|
923b
|
42 lines
#define CTRL_B 2
#define BOXCHAR "*"
init()
{
assign_key("box", CTRL_B); /* <CTRL> B */
}
/* box() - this macro draws a comment box around a marked region */
box()
{
int col1, col2; /* starting and ending columns of the marked region */
int line1, line2; /* starting and ending lines of the marked region */
int width; /* number of characters across (really col2-col1+1) */
col1 = marked_col(); col2 = currcol();
line1 = marked_line(); line2 = currlinenum();
width = col2 - col1 + 1;
goline(line1);
insline();
setcol(col1);
insert(strcat("/", repstr(BOXCHAR, width)));
down();
while (currlinenum() <= line2 + 1)
{
setcol(col1);
insert("*");
setcol(col2+1);
insert(BOXCHAR);
down();
}
insline();
setcol(col1);
insert(strcat(repstr(BOXCHAR, width), "/"));
clear_mark();
}