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.

SET HEADINGS, Set(“Headings”)

This is a schizophrenic command that controls two similar, but unrelated, things. SET HEADINGS determines whether column headings appear in the output of commands that list fields. It also determines whether TYPEing a file includes the name of the file and the date. Why are these things linked together? Who knows?

Usage

SET HEADINGS ON | OFF
cCurrentHeadings = SET("HEADINGS")

In its first incarnation (column headings for listing commands), SET HEADINGS affects DISPLAY, LIST, AVERAGE, CALCULATE and SUM.

Example

cOldHead=SET("HEADINGS")
SET HEADINGS OFF
USE Employee
* Rough average age
AVERAGE YEAR(DATE())-YEAR(Birth_Date) FOR NOT EMPTY(Birth_Date)
SET HEADINGS &cOldHead

See Also

Average, Calculate, Display, List, Set, Sum, Type