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.

FileClass, FileClassLibrary

These properties indicate the name of the class on which a form is based and the class library containing that class. They apply to File objects.

Usage

cClass = filFile.FileClass
cClassLib = filFile.FileClassLibrary

Forms contain information about their class and class library in the Class and ClassLibrary properties. (Big surprise.) But that information is available only when the form is open. When you’re working on a project and want to know the provenance of its forms, use FileClass and FileClassLibrary. (Seems to us this is most useful for documentation tools.)

These properties contain the empty string for files other than screens.

Example

FOR EACH oFile IN oProj.Files
   IF NOT EMPTY(oFile.FileClass)
      ?oFile.Name + " is based on class: " + oFile.FileClass + ;
       " from classlib: " + oFile.FileClassLibrary
   ENDIF
ENDFOR

See Also

Class, ClassLibrary, File, Files, Project