#### Using Expressions and Tracefields to Customize Headers and Footers

You'll notice that the keywords themselves aren't customizable. For example the #DATE keyword in the logo.dat file only gives you one way to display the date—in mm-dd-yyyy format. For example May 5, 2005 is written as 5-5-2005 in your Edit window's header or footer.

The following example shows how you can use expressions and tracefields to change the format of your date on the Edit window.

1. Type the following commands somewhere into your part program :

ASSIGN/V1 = SYSTEMDATE("MMM dd, yyyy")

This gives V1 the string value of "May 05, 2005" (or whatever your current date is).

TRACEFIELD/DISPLAY,LIMIT=15 ; DATE : V1

This assigns V1 to the TRACEFIELD.

2. Assuming this is the first tracefield in your program, open up your logo.dat file inside a text editor and modify the DATE= field so that it looks like this:

DATE=#TR1

Notice that DATE field now references the first trace field by using #TR1.

3. Save and close your logo.dat file.

4. Access the Edit window. Assuming your Edit window is enabled to show headers and footers, the header now uses the formatted system date that was stored in the V1 variable and subsequently in the first trace field.

You can use trace fields and expressions to give you greater control over what you see in the Edit window.

For information on trace fields, see the "Using Trace Fields" topic in the "Tracking Statistical Data" section.

For information on expressions, see the "Using Expressions and Variables" section.

For information on modifying your Report's headers or footers, see "Modifying your Report's Header".