Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.
Here are three properties you might have some difficulty finding in the reference books (except this one, of course) when you have trouble with them in a program. They are used in “READ-compatibility” mode only, and ought to be avoided like the plague.
frmForm.ErasePage = lEraseOrNot
lEraseOrNot = frmForm.ErasePage
frmForm.ReleaseErase = lEraseOnRelease
lEraseOnRelease = frmForm.ReleaseErase
frmForm.ReleaseWindows = lRelease
lRelease = frmForm.ReleaseWindows
Parameter |
Value |
Meaning |
lEraseOrNot |
Logical |
Determines whether one page is erased when a child READ level is called, or whether the image is preserved for the return from the nested READ. |
lEraseOnRelease |
Logical |
Determines whether a control's image should be saved on the screen after the control has been released or the READ has terminated. |
lRelease |
Logical |
The equivalent to the Release Windows check box in the generator options of converted forms, this determines whether the images of windows are preserved after the READ that created them has been terminated. This trick was used with great success in Y. Alan Griver's "CodeBook" series for FoxPro 2.x, but VFP's event and form models make it unnecessary. |
In Hacker’s Guide for Visual FoxPro 3.0, we speculated that these properties were last-minute additions to the READ-compatibility model, since they are not documented in the printed materials, the Help file, or even the Readme file. Microsoft has had numerous opportunities to correct this, if it was truly an oversight. We’ve concluded that Microsoft just didn’t want us messing with them. And they’re probably right.
We’re willing to go along with that idea for these properties. While they do provide a better level of compatibility with code written for the old READ model, we don’t plan to run any forms in compatibility mode, except under the most dire of circumstances. Nested READs and READ SAVE tricks were nice features to be able to try in the 2.x model, but they are not part of the main-form management scheme, and trying to integrate them into a true VFP product will certainly cause trouble.
These properties are not native properties of the base class Form, but are added to the form in Convert.PRG (check it out in the subdirectory HOME()
+\TOOLS\CONVERT).