Home About us Development Training Support |
IntelliSense in VFPIntelliSense was advertised as something that would bring VFP up to the level of Visual Basic but in typical Fox fashion the team went one better. IntelliSense provides a variety of services but I like the way we can add our own entries to the FoxCode table. As an example, if I type in a program now I get:
*-- |
*-- Changed by Geoff Franklin - 23/08/02 where the date is inserted automatically and the cursor is positioned one space to the right of the '*--' on the first line, ready for me to type in my comments. It's a big help when I'm editing other people's code. I've always known that I ought to be commenting my changes and I do it more now that it's easy. How to do itYou can hack the FoxCode table directly but it's easier to start by using the IntelliSense Manager. This is available on the DO FoxCode in the Command Window. menu or by typing
LPARAMETER oFoxCode LOCAL lcDate && System date as a string. LOCAL lcComment && The text to be inserted. lcDate = DTOC(DATE()) IF oFoxCode.Location = 1 *-- We're editing a program so make the substitution. *-- The tilde marks where the insertion point will be. *-- There's a space after the tilde. *-- The expression in the <<double chevrons>> *-- will be evaluated. oFoxcode.valuetype = 'V' TEXT TO lcComment TEXTMERGE NOSHOW *-- ~ *-- Geoff Franklin - <<lcDate>> ENDTEXT ELSE *-- We're not editing so return the keystrokes unchanged lcComment = oFoxCode.Abbrev ENDIF RETURN lcComment
Other usesI've also modified the IntelliSense entries to help me write HTML. I'm writing this in VFP 7 now and I've just inserted a pair of paragraph tags:
<p>
| </p> by typing the two-character code . This inserts the tags then moves up a line and two spaces across so that my text will be nicely formatted.Further informationThere's some help in VFP Help under 'IntelliSense' and 'Scripting' and you can look at the sample entries on the IntelliSense Manager. There are more good examples on the VFP Wiki under CategoryIntelliSense.
|
Hints & tips
The textbox class in Visual FoxPro 9 has a new Autocomplete
property which shows the user the previous values that have
been entered in that textbox.
More...
|