Inserts statements into a file.
Scope: File
Syntax
Description
The proto command provides a simple mechanism for inserting statements into programs. For example, you could use proto to insert simple logic structures such as IF, DO, or WHILE, or calls to other applications.
If you assign the mechanism to a key, then when the cursor is placed on any keyword such as if, pressing the selected key expands the keyword into a prototype pattern.
The external command proto proto.c is assigned to the Ctrl+R key by the C tokenizer (parser). The global variables are set up in c.lxl. When the C/C++ files have been opened in the Editor, you can use the Global Variables selection in the Options pull-down menu to query and amend the variables.
| Note: | The source code for the proto command is in the \extras directory. |
Parameter
Name |
Can be any prefix used to set up the global variables; for example proto.c. |
Example
To insert an if statement:
if (?) {
} else {
}
and the cursor is positioned on the question mark.
For further details on proto and how it works, read the source code that is provided as lxproto.c in the extras directory.
![]()
Application Programming Interface Overview contains general information about creating and adding new commands using a library of subroutines.
Building External Commands Written in the C Language describes how to build external commands.
Sample External Command: fmatch
Sample External Command: match
