Type
Every item in a project has some native type, like form, menu, free table, and so forth. The Type property indicates that type.
Usage |
cTypeChar = filFile.Type |
Type is read-write! You can change the type of a file. VFP seems amazingly immune to weird values in the Type field. We were able to change the type of a program from "P" to "D" and then call the Modify method without trashing the project or crashing VFP. Not only that, but the appropriate editing window opened up. It does make you wonder what the point of the Type field is, though. It also means you need to be pretty careful about code like the example, since Type may not accurately identify the file type. Our view is that changing this property is a really bad idea. Just because they let you doesn't mean you have to do it. |
Example |
* Use Type to figure out whether or how you want to process * each file in a project. Here we'll open forms and programs, * and ignore everything else. oProj = _VFP.ActiveProject FOR EACH oFile IN oProj IF oFile.Type $ "PK" && Program or Form oFile.Modify() ENDIF ENDFOR |
See Also |