Footnote class | footnote.t[38]

Footnote - this allows footnote references to be generated in displayed text, and the user to retrieve the contents of the footnote on demand.

Create an instance of Footnote for each footnote. For each footnote object, define the "desc" property as a double-quoted string (or method) displaying the footnote's contents.

To display a footnote reference in a passage of text, call <<x.noteRef>>, where x is the footnote object in question. That's all you have to do - we'll automatically assign the footnote a sequential number (so that footnote references are always seen by the player in ascending order, regardless of the order in which the player encounters the sources of the footnotes), and the NOTE command will automatically figure out which footnote object is involved for a given footnote number.

This class also serves as a daemon notification object to receive per-command daemon calls. The first time we show a footnote reference, we'll show an explanation of how footnotes work.

`class Footnote : object`

Superclass Tree (in declaration order)

`Footnote`
`object`

Subclass Tree

(none)

Global Objects

(none)

Summary of Properties

`desc everShownFootnote footnoteNum footnoteRead footnoteSettings lastFootnote numberedFootnotes`

Summary of Methods

`checkNotification showFootnote`

Properties

`desc` | `footnote.t[44]`

Display the contents of the footnote - this will be called when the user asks to show the footnote with the "NOTE n" command. Each instance must provide suitable text here.

`everShownFootnote` | `footnote.t[184]`

static property: we've never shown a footnote reference before

`footnoteNum` | `footnote.t[159]`

my footnote number - this is assigned the first time I'm referenced; initially we have no number, since we don't want to assign a number until the note is first referenced

`footnoteRead` | `footnote.t[167]`

Flag: this footnote's full text has been displayed. This refers to the text of the footnote itself, not the reference, so this is only set when the "FOOTNOTE n" command is used to read this footnote.

`footnoteSettings` | `footnote.t[152]`

SettingsItem tracking our current status

`lastFootnote` | `footnote.t[174]`

Static property: the highest footnote number currently in use. We start this at zero, because zero is never a valid footnote number.

`numberedFootnotes` | `footnote.t[181]`

Static property: a vector of all footnotes which have had numbers assigned. We use this to find a footnote object given its note number.

Methods

`checkNotification ( )` | `footnote.t[187]`

static property: per-command-prompt daemon entrypoint

`showFootnote (num)` | `footnote.t[120]`

Display a footnote given its number. If there is no such footnote, we'll display an error message saying so. (This is a class method, so it should be called directly on Footnote, not on instances of Footnote.)

TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3