Inform 7 Home Page / Documentation
§5.5. Text with lists
We often want running text to include lists of items.
say "[list of (description of objects)]"
This text substitution produces a list, in sentence form, of everything matching the description. Example:
"Mr Darcy glares proudly at you. He is wearing [list of things worn by Darcy] and carrying [list of things carried by Darcy]."
And, if this were from a dramatisation of the novel by Miss Fielding rather than Miss Austen, we might find:
Mr Darcy glares proudly at you. He is wearing a pair of Newcastle United boxer shorts and carrying a self-help book.
If the description matches nothing - for instance, if Darcy has empty hands - then "nothing" is printed.
As with all lists in Inform, the serial comma is only used if the "Use serial comma." option is in force. So by default we would get "a fishing pole, a hook and a sinker", rather than "a fishing pole, a hook, and a sinker".
We then need variations to add indefinite or definite articles, and to capitalise the first item. For example,
"Mr Darcy impatiently bundles [the list of things carried by Darcy] into your hands and stomps out of the room."
might result in
Mr Darcy impatiently bundles the self-help book and the Christmas card into your hands and stomps out of the room.
say "[a list of (description of objects)]"
This text substitution produces a list, in sentence form, of everything matching the description. Each item is prefaced by its indefinite article. Example:
a maritime bill of lading, some hemp rope and Falconer's Naval Dictionary
say "[A list of (description of objects)]"
This text substitution produces a list, in sentence form, of everything matching the description. Each item is prefaced by its indefinite article, and the first is capitalised, so that it can be used at the beginning of a sentence. Example:
A maritime bill of lading, some hemp rope and Falconer's Naval Dictionary
say "[the list of (description of objects)]"
This text substitution produces a list, in sentence form, of everything matching the description. Each item is prefaced by its definite article. Example:
the maritime bill of lading, the hemp rope and Falconer's Naval Dictionary
say "[The list of (description of objects)]"
This text substitution produces a list, in sentence form, of everything matching the description. Each item is prefaced by its definite article, and the first is capitalised, so that it can be used at the beginning of a sentence. Example:
The maritime bill of lading, the hemp rope and Falconer's Naval Dictionary
So much for articles. A more insidious problem comes with something like this:
The trouble is that the list may end up either singular or plural. We might be expecting something like:
The places you can go are Old Bailey, Bridget's Flat and TV Centre.
But if there is only one room, then the result might be:
which is wrong. We can get around this with careful wording and a slightly different substitution:
say "[is-are list of (description of objects)]"
This text substitution produces a list, in sentence form, of everything matching the description. The whole list starts with "is" (if there's one item or none) or "are" (more than one). Examples:
is marlin-spike
are maritime bill of lading, hemp rope and Falconer's Naval Dictionary
say "[is-are a list of (description of objects)]"
This text substitution produces a list, in sentence form, of everything matching the description. Each item is prefaced by its indefinite article, and the whole list starts with "is" (if there's one item or none) or "are" (more than one). Examples:
is a marlin-spike
are a maritime bill of lading, some hemp rope and Falconer's Naval Dictionary
say "[is-are the list of (description of objects)]"
This text substitution produces a list, in sentence form, of everything matching the description. Each item is prefaced by its definite article, and the whole list starts with "is" (if there's one item or none) or "are" (more than one). Examples:
is the marlin-spike
are the maritime bill of lading, the hemp rope and Falconer's Naval Dictionary
say "[a list of (description of objects) including contents]"
This text substitution produces a list, in sentence form, of everything matching the description, noting any contents in brackets. This is really intended only to be used by the Standard Rules.
Control Center |
Tiny Garden |