Logo

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.

DoCreate

This may be the most mysterious property we’ve encountered. It’s documented only as a reserved word, appears in just about every form we’ve come across, but can’t be accessed at runtime and doesn’t seem to do much of anything.

Usage

frmForm.DoCreate = lLogicalValue

Though we’ve shown the value as accepting either logical value, in practice we’ve only ever encountered .T.

By now, you may be wondering why you’ve never run across this property. (We’re beginning to wish we hadn’t.) It’s not hard to miss it. It doesn’t appear in either the property sheet or the debugger and you can’t refer to it in code either at design-time or runtime.

So where did we find this one? One of the nice things the Class Browser can do for you is provide you a list of what your class or form would look like (more or less) if you wrote it in code instead of using the appropriate designer. When we ask the Browser to show us the code for pretty much any form we create, the opening section includes the line:

DoCreate = .T.

According to one of our sources, this hidden property is for internal use only. When the line is encountered, VFP optimizes form load performance and memory usage. Otherwise, there is a tiny bit more memory used by the form. On Della’s machine, a blank form with DoCreate = .T. averages about 16,000 bytes, and one created with DoCreate = .F. averages around 17,400 bytes. The range of bytes that DoCreate buys you appears to be in the neighborhood of 900 to 1500 bytes. That’s not substantial enough for us to want to incorporate this into our applications.

See Also

Forms