# heading statement

The heading statement designates a text
string composed of literals and special options to output at the top
of each page.

## Syntax

```
heading str.exp
heading "{{text} {’options’}...}"
```

## Description

*str.exp* is
any valid literal string, string expression, or variable. A literal
string must be enclosed in either double quotation marks or backslashes
because heading *options* must be enclosed within
single quotation marks to distinguish them from *text*. Multiple options can be enclosed in the same set of single quotation
marks.

The heading can be changed with a new heading statement, which outputs the revised heading at the beginning of
the next page. The first time the heading is activated, it is output
directly to the screen.

The page statement
is used to force pagination.

The system(4) function maintains line and system(5) maintains
page counters while heading and footing are active.

Note: There is a 1400 character limit to heading
strings.

Under normal circumstances, a heading statement executed when there is another heading active does not
display anything until the next page. However, D3 redisplays the heading
immediately if the current page number is 0.

Mixing heading and footing statements with
direct cursor addressing commands is not allowed.

## Example(s)

In this example, the heading option string is assigned to the variable `head` and subsequently assigned as the heading.

```
heading "’lc’page ’pn’ printed at ’tlc’ this end into shredder first.’l’"
head = \’c’this is a heading’l’\
heading head
```

## See also

- [break-on modifier](https://d3codex.com/access/break-on-modifier/)
- [crt statement](https://d3codex.com/pickbasic-flashbasic/crt-statement/)
- [footing statement](https://d3codex.com/pickbasic-flashbasic/footing-statement/)
- [page statement](https://d3codex.com/pickbasic-flashbasic/page-statement/)
- [printer statement](https://d3codex.com/pickbasic-flashbasic/printer-statement/)
- [roll-on modifier](https://d3codex.com/access/roll-on-modifier/)
- [Statements and functions](https://d3codex.com/pickbasic-flashbasic/statements-and-functions/)
- [system() function](https://d3codex.com/pickbasic-flashbasic/system-function/)
- [\ arithmetic operator](https://d3codex.com/pickbasic-flashbasic/backslash-arithmetic-operator/)

---
Source: https://d3codex.com/pickbasic-flashbasic/heading-statement/ - part of the D3Codex reference.
