7 |
The LA Fox Developer Newsletter
May 1998
18 VFP Productivity Boosters
bunch of time-saving tips that all VFP developers can use.
n the brochure for our Visual FoxPro training courses, we claim
hat our training “will make you a faster and more productive
developer" Fortunately, that’s an easy boast to live up to, given
that VFP is crammed full of useful shortcuts designed to save
the
programmer valuable time.
ro
be honest, none of these techniques will save you a huge
3mount of time on its own. But, used together over the course of
a development project, they could make a noticeable difference
to your productivity
—
as well as making VFP a pleasanter place
to work in.
So let’s get started
1 .For a fast way of opening a table in the VFP development
environment, just click on its name in the Project Manager.
2.Holding down Ctrl, Alt and Shift simultaneously will tempo-
rarily hide all open windows, which is great if you need to see
some output on the background screen. Release the keys to
bring the windows back.
3.lf the Command Window is lost deep in your desktop, hit
Ctrl-F2 to bring it quickly to the front.
4.Talking of the Command Window, you know that you can
scroll back and re-execute earlier commands. But did you know
that you can also execute entire blocks of commands? To do
so, highlight the block and hit Enter.
5.When working on the design surface within the Form
Designer, hit Tab to quickly bring the property window to the
front.
6.Press Ctrl-PgUp and Ctrl-PgDn in the property window to
cycle through the object list (in VFP 5.0 only).
7.To quickly locate a given property, press Ctrl, Shift and the
first letter of the name. Pressing Ctrl-Shift-F, for instance, will
take you to the first property whose name begins with F.
8.ln the code window in the Form Designer, PgUp and PgDn
will cycle through all the methods which actually contain code.
9.And double-clicking on an object on the design surface will
take you to the first method in alphabetical order which contains
code for the object.
I0.lf you go to Tools Options
f
Forms and de-select “Prompt
to save changes before running form”, the form will be automati-
cally saved each time you run it from the designer.
II .When dropping a class on the form, if you cannot find the
appropriate button on the toolbar, drag the class from the
Project Manager instead.
12.If you cannot figure out what’s gone wrong with the form, it
usually pays to focus on the properties and methods that have
changed from their defaults. In both 3.0 and 5.0, these are
highlighted in bold within the property window. In 5.0, you can
go one better by right-clicking on the property window and
selecting “Non-Default Properties Only”. This will hide every-
thing that is unchanged, making it easier to see what you have
altered.
13.How many times have you needed to type a field name in
your code, only to find that you could not remember the exact
name or the spelling? In 5.0, just right-click, select Build
Expression, and pick the field from the expression builder (this
assumes that the table is open in the development environ-
ment).
14.Or
...
simply drag the field from the Project Manager (or
database container) and drop
it in
the editor.
1 5.Similarly, you can insert a fully qualified object name (such
as THISFORM.MyGrid.Columnl .NameField) by right-clicking in
the editor, selecting Object List, and picking the appropriate
name from the resulting dialog (in 5.0 only).
16.Need to comment-out a large block of code (in 5.0)? Select
the code in question, right-click, and pick Comment. Reverse
the action by picking Uncomment. The nice thing about this is
that the IJncomment command acts only on code that was
disabled by the Comment command, not any existing com-
ments within the block.
I 7.Developers moving from FoxPro 2.x to VFP 3.0 are often
dismayed to find that the Beautify feature has been retired. In
5.0, it makes a come-back. Look for it on the right-click menu
in the code editor.
I 8.If you don’t want to be nagged to run a wizard every time
you start a new form, report or whatever, visit Tools
I
Options
I
Projects and de-select “Prompt for Wizards”. This affects the
New button in the Project Manager, but not the File
I
New
command or the New button on the main toolbar.
(Copyright, Mike Lewis Consultants Ltd. 1998.)
Join
LA Fox
Page
7
|
7 |