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.
DISPLAY OBJECTS
, LIST OBJECTS
These commands show information about the structure and content of all instantiated objects.
DISPLAY | LIST OBJECTS
[ TO PRINTER [ PROMPT ]
| TO [ FILE ] cFileName [ ADDITIVE ] ]
[ NOCONSOLE ]
Be prepared for a lot of output from this command. For each object, it shows the class hierarchy, a complete list of properties and their values, a list of member objects, and a list of methods and events.
You can get most of the information in the listing using AINSTANCE()
and AMEMBERS()
, but the only other way we’ve found to get a list of existing objects is with DISPLAY/LIST MEMORY
.
These commands show information about each named object. This leads to a subtle and annoying bug. When you run a form with DO FORM, unless you add the NAME clause, the object created has the same name as the form itself. If you run the same form several times without the NAME clause, all the objects are referenced through the same variable. Visual FoxPro somehow keeps things straight internally, but DISPLAY and LIST OBJECTS show you only one instance of the form. (Of course, when you create multiple instances of a single form, you should give each a unique name.) |
o1=CREATEOBJECT("form")
LIST OBJECTS TO FILE object.txt NOCONSOLE
AInstance(), AMembers(), CreateObject(), Display and List, Do Form