Display Objects, List Objects

These commands show information about the structure and content of all instantiated objects.

Usage

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.)


Example

o1=CREATEOBJECT("form")
LIST OBJECTS TO FILE object.txt NOCONSOLE

See Also

AInstance(), AMembers(), CreateObject(), Display and List, Do Form


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .