home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
ME22-OS2.ZIP
/
MACROS.ZIP
/
C.M
< prev
next >
Wrap
Text File
|
1986-12-29
|
763b
|
48 lines
/* These macros are for C programmers - inserts a "for" template */
/* and an "if" template */
init()
{
assign_key("formac", 6); /* <CTRL> F */
assign_key("ifmac", 5); /* <CTRL> E */
}
formac()
{
int col;
int i;
col = currcol();
insert("for ( ; ; )\n");
setcol(col);
insert("{\n");
setcol(col);
insert("}");
up(); up();
for (i = 1; i <= 4; i += 1)
right();
}
ifmac()
{
int col;
int i;
col = currcol();
insert("if ()\n");
setcol(col);
insert("{\n");
setcol(col);
insert("}\n");
setcol(col);
insert("else\n");
setcol(col);
insert("{\n");
setcol(col);
insert("}");
for (i = 1; i <= 5; i++)
up();
for (i = 1; i <= 3; i++)
right();
}