Wiki Home

VFP Gotchas IDE


Namespace: VFP

Idiosyncrasies in VFP that may surprise the uninitiated.

Also see VFP Gotchas
Project Hooks: new hook doesn't take effect till you bounce (close and open) the pjx - If there was already one set, it is still in effect even after you change the hook to point to the new one.
Many VFP UI controls are containers. You must put the container in 'edit mode' before you can drop controls on it. For example, if you have a form in your class editor and drop a page from on it. The page frame is contained in the form. If you now drop a textbox on the class editor it will be contained on the form. This may be what you want (it will show on all pages) but most likley you ment to drop the control on the page.

To put the container into edit mode, select it, right click and choose edit. You will see a blue, broken border drawn around the container. You may have to repeat this many times. To edit the column of a grid, on the page, of a page frame, on a form.

In VFP 7.0, two key/mouse shortcuts where added to make it easier to drill down without using the edit item on the menu:

CTRL+SHIFT+Click on the control Drills down to a control in a container.

CTRL+Click on the container Drills down through the container.
When editing code in the class or form editor, in order for VFP to store which method you are editing (i.e., you want it to open that method the next time you modify the class or form), leave the code window open and close the class (or form) editor window. If you close the code editor window first, VFP will open with no code window next time the class or form is opened.

For example, try this:
MODIFY FORM myNewForm and when the design surface comes up add a command button, double click it, and add a comment to its Click() event. Then hit Ctrl + W, to save the Code window, and then Ctrl + W again to save the form. Now the next time you modify the form, only the form comes up and not the code window. If you bring up that code window again, and then click back on the Form Designer and hit Ctrl + W, while the code window is still in the background, the next time you modify that form, the code window will automatically be displayed.
The Properties sheet is unable to know very much about what you type into it when changing the value of a user-defined PEM. It knows that .T. and .F. are logicals, and it will recognize numbers. Other sequences are treated as strings. The positive side of this is that you won't have to remember to delimit string values with "" or '' or []. However, it also means that when you enter, say, PI()^2, you'll be storing the string "PI()^2" to that property rather than 9.869604401089358. To store the actual result of an expression, precede the expression with an equals-sign, like so: =PI()^2.

To set a prop to a string of digits, enter these 4 chars:
="1" - If you just put 1, you get a numeric, and if you put "1" you get the quotes too.

To optimally set a property to an empty string, select the property on the property sheet and hit the delete key. (None) will appear just like it does for the native properties. You can also use ="" or =Space(0), but that needlessly wastes space (bloats the VCT) and increases instantiation time of the objects.
There doesn't seem to be any way to select all pages (or even just more than one) in a pageframe in order to set options of multiple pages at the same time (VPF6 anyways). You can select a group of option buttons, and a group of radio buttons, but you can't select a group of pages in a pageframe. Michael Wagner

As a consequence of the item above and the fact that changing pageorder on one frame resets others, there's no good (non-tedious) way to set pageorder for all pages in a pageframe back to the default (i.e. get back to the order defined in the class you're using). Michael Wagner
Contributors: Carl Karsten Lauren Clarke Frank Camp Peter Crabtree df
Category VFP Tips And Tricks Category VFP IDE
( Topic last updated: 2005.08.08 04:03:07 PM )