AutoText Overview
Many times during the process of code writing you have
probably used identical or similar blocks of
code, or written the same instructions over
and over. In such cases, an auto-text feature,
like the one found in many professional text editors,
could save you a lot of time, keeping you concentrated
more on your program's logic. Typing a few letters or
hitting a special key combination is much more productive
than writing, from scratch, the same pieces of code, again
and again. This is what the CodeSMART AutoText
system was built to do in order to ease the process
of coding, make it faster and therefore more
efficient.
An auto-text item consists of:
-
A block of Visual Basic code.
-
An alias which usually represents a two or three
character text. Once this text is typed into the Visual
Basic code window and a special key like blank, enter,
arrow keys etc. is pressed, it will be replaced with the
auto-text's code.
Here are a few samples showing how the CodeSMART AutoText
tool can improve your coding speed. Type one of
the following aliases into a Visual Basic code
window press SPACE or ENTER and see the results:
|
orn
|
|
On Error Resume Next
|
|
- or -
|
|
|
|
mb
|
|
MsgBox("|")
|
|
- or -
|
|
|
|
if
|
|
If | Then
End If
|
The "|" character stands for the cursor position.
Once a special key (like SPACE or ENTER) is pressed
the just-inserted alias is completely replaced by its
corresponding piece of code. And this is not a simple
text replacement but a SMART and flexible operation:
-
The code behind auto-text items is completely customizable.
-
The auto-text item code can be enriched with standard
parameters. Thus it can automatically update
its contents based on the insertion context.
-
In-place values for user-defined parameters are supported
through custom parameters.
-
The cursor position and even the selected text range,
as a result of the insertion, can be precisely set.
To manage the auto-text items you can use the AutoText
Manager. This is a special tool that allows the
creation of new auto-text items, and the
management of the existing ones (modification
and removal) . Also, the auto-text items can be
organized into folders, imported and exported,
and a list of existing items and their associated triggers
can be printed for later reference.
See also
Back To Top
|