Fields - heading


field_id, [”heading”], type & size [[dim1 [, dim2 [, dim3 [, dim4]]]]] \
[/logical] [,”format” [, flags [, “validation”]]]

Field headings provide the means to assign a default heading to the field, to be used when the field is displayed on the screen in a textbox or printed in a report.

Any characters may be used in the heading, which must be enclosed in double quotes.

Specification of a field heading is optional. If no heading is provided, the heading defaults to the field’s name (field_id). The use of two consecutive commas at this position (with or without intervening white space) indicates that no heading is being specified. It is essential that this is done because otherwise Sculptor will assume that the next part of the specification, the type & size, is meant as a heading.

If no heading at all is required, enter two empty quote marks (“”). This over-rides the default use of the field_id as heading.


Assigning or retrieving a heading at run time

A field heading may be assigned at run time:

field_id->heading = text_expression

This is most commonly used to specify a print heading in a !report section. A convenient place to place the command is within the !init section of the report.

Although the command can also be used for screen display, it is generally more appropriate to assign a heading by means of the label = clause of the textbox to which the field is linked. The label defaults to the field heading. The label may similarly be changed at run time by the command:

box_id->label = text_expression

The form field_id->heading can also be used to retrieve a field heading.


EXAMPLE

!ofile Codes "data/codes" read

!temp Name,"NAME",a10[20]         /* heading is "NAME" */
!temp Surname,,a10[20]            /* heading is "Surname" */
!temp Counter,"",i1               /* heading is "" (none) */

+window Win1 at 0,0 {

     +textbox SurnameBox at 40,34 {
          field = tmp.Surname     /* heading is now "SURNAME" */
          label = "SURNAME"
     }

     +textbox CatBox at 40,64 {
          field = Codes.category  /* heading is  "CAT "  */
          label = "CAT "
     }

}

In the last example, the heading “CAT ” over-rides any heading given to the field when it was created with the ddeditor program. Note the trailing space, which causes a space to be printed between the label and the textbox.


RELATED TOPICS

Data fields