Here is the list of keywords expanded by the C123.VTM template editing macro.
Indent style "1" is used in these examples.
The keywords are expanded when you type a space after typing the text in the left column
(except for ';' in for statement, which is expanded immediatelly).
Cursor position is indicated as ''.
when you type... | it expands to... |
if ![]() |
if (![]() } |
ife ![]() |
if (![]() } else { } |
else if ![]() |
else if (![]() } |
if( ![]() |
if (![]() |
do ![]() |
do { } while ( ![]() |
while ![]() |
while (![]() } |
for ![]() |
for (![]() } |
;![]() (inside for statement) |
for (v=a; v<![]() } |
switch ![]() |
switch (![]() case : break; case : break; default : } |
case ![]() |
case ![]() break; |
printf ![]() |
printf("![]() |
cprintf ![]() |
cprintf("![]() |
sprintf ![]() |
sprintf(![]() |
#de ![]() |
#define |
#in ![]() |
#include <![]() |
#inc ![]() |
#include "![]() |
One of three indenting styles can be selected (option "C Macro setup" -> "Indent" in the C-User menu):
style option | example |
1 ('{' at same line) |
if (x>1) { foo(); } |
2 ('{' at next line) |
if (x>1) { foo(); } |
3 ('{' at next line, indented) |
if (x>1) { foo(); } |
In addition, you can select if spaces are added between the keyword and opening parentheses, inside the parentheses, both, or neither. The examples above has the first option enabled.