Tips und Tricks

Inhalt  Zurück  Weiter

 

I have written down some instructions to gain more productivity using IntelliSal

in a tea talk article that can be downloaded here:

 

www.iceteagroup.com/TeaTalk/Articles/2001/20010102.pdf   17.096 Byte

 


 
Thereīs no doubt that IntelliSal offers a lot of obvious features that help developers work more effective. To name a few: Tooltips, Sal function description, member/method lists, ...
 
But thereīs another side of IntelliSal that Iīd like to present here.
 
Itīs a list of some rather small, but interesting features that one might miss if IntelliSal is not evaluated carefully.
 
I think these features help developers feel more comfortable inside the code they are creating or maybe more important have to maintain.
 
We appreciate your feedback!
IntelliSal has only become so popular because of all your praise, criticism and ideas so help us to even improve it!
 

1. Integration of external help files

 
IntelliSal offers an o ption to declare rules of how external help files should be integrated.
Where does this makes sense you might ask, but suppose you are using the popular ClassIQ object framework.
Thereīs an underlying naming convention that every global function starts with Iq.
Of course ClassIq ships with a nice help file explaining each of these functions, so why not integrate it as nicely as the Centura help file:
Open Intelli.Ini with a standard text-editor (like Notepad)
Create a section [EXTERNALHELP] if it does not exist
Within this section create an entry using this format:
HELP<n>=<Prefix>#<PATH>CLASSIQ.HLP
Example:
HELP1=IQ#C:\classiq\classiq.hlp
Now when you type e.g. IqArrayToList followed by an opening bracket ("(") and the tooltip pops up, you can press F1 and you are directed to the Class IQ help file at the appropriate page.
 
The same works in a list of functions or if you select the function with the mouse and press F1.
The same of course works for the most extensive code library XSal, simply use the prefix XSAL.
 
In the examples above we were dealing with "classical" help files. What about the more modern ones build in HTML?
Well of course IntelliSal covers them, too. Simply add #HTML after the helpfile name and that's it.
An interesting sample might be to jump into the MSDN help file for every function starting with REG (normally used to read/write from/to the registry).
Hereīs what to add to Intelli.Ini (with a sample path of my MSDN installation)
HELP2=REG#D:\APPS\Microsoft Visual Studio\MSDN\2000JAN\1033\MSDN000.COL#HTML
If you want to add your own help files, you simply have to take care of the following two guidelines:
a) Make sure to use a common prefix for your functions
b) Build up a keyword list inside your helpfiles to assure that the correct page is displayed.
 

2. Improve your typing speed with Autotext

 
IntelliSal has another nice feature that Iīd like to present.
Itīs called autotext and is basically a mechanism that saves typing time.
One function that is very often called in a typical CTD application is SalSendMsg. While this is easy to read, it is definitely difficult to type.
With the built -in mechanism you can type salsendmsg (all lower case) and it gets automatically converted.
But you ca n save even more time by defining an autotext entry like e.g. ssm.
With this you can simply type ssm and it will be expanded to SalSendMsg.
How to configure such an autotext entry ?
 
Well, itīs fairly simple, just edit Intelli.INI and add the following:
[AUTOTEXT]
REPLACE_1=ssm#SalSendMsg
 
The syntax of such an entry is:
REPLACE_<n>=<text to be replaced>#<replacement string>
You might also want to use the autotext feature to correct common typos on the fly.
Iīm for example constantly typing SalSendMessage where I actually mean SalSendMsg. Well with autotext this is history.
My feeling is that possibilities of autotext are virtually unlimited.
Tip:
If you need to undo a replacement, itīs enough to simply press ALT+BACKSPACE.
 

3. Apply to your companies naming conventions

 
IntelliSal is able to help you in being conform with your companies naming conventions.
A common practice in coding is to prefix variables with a letter that depends on the variable type.
You could use the following conventions for example:
 

TypPrefix
Strings
Numbern
Window HandlehWnd
SQL HandlehSql

 
Wouldnīt it be nice, if CTD took care of these automatically? Well with IntelliSal it does.
If you define the naming conventions shown above, each new String variable you create is automatically prefixed with the appropriate prefix-text.
Itīs extremely simple.
There's something else worth to be mentioned.
In many companies it is common to have a different prefix depending on the scope of a variable.
If you have a window variable for example, you add a w to it, so that a window variable of type string would be prefixed as ws.
How can I define the conventions ?
IntelliSal ships with a simple configurator called namingrulexx.exe where xx stands for the version of CTD.
Once you start it, you see a tree with all the different code locations where variables can be defined is a CTD application.
Just edit the prefixes and when youīre finished, press save all. All changes are written to Intelli.Ini then.
Q: "I have several workstations equipped with IntelliSal. Do I need to define the settings for each PC?"
A: No. You can use a central Intelli.ini stored anywhere on your network and simply start the IntelliSal configurator and adjust the location of the Intelli.ini.
This also allows you to have common autotext settings.
Tip:
You can also define prefixes for windows and classes. It works the same way as for variables. This way you can e.g. define df as the common prefix for data fields or clsdf as a prefix for data field classes.
Q: "Why should I care about naming conventions at all?"
A: Well, basically itīs a way to guarantee a quality of your code.
You add more transparency since you can determine the type of a variable/window simply by looking at itīs name.
It makes your code easier to read and to maintain and of course itīs easier to share code inside your company when all your colleagues use the same naming pattern. IntelliSal simply helps you apply to your conventions.