It seems like I’m missing something obvious here, but I can’t figure it out. I’ve been banging my head against this for over an hour.
What I want is to print a quotation where each line is indented. (Not being satisfied with the display the boxed quotation
functionality in Inform, I’m working up a way to print a “this is a new major section of the work” screen that contains a quotation, instead.) Here’s what I’ve got so far:
To quotedly say (witty saying - some text):
repeat with line_no running from 1 to the number of lines in the witty saying:
say "[fixed letter spacing] [variable letter spacing][line number line_no in the witty saying]"
To print a/-- title page for chapter (Which Chapter - a number):
say "[italic type](Press any key to continue.)[roman type][paragraph break]";
wait for any key;
repeat with X running from 1 to 10 begin;
say paragraph break;
end repeat;
let the witty quote be the quote corresponding to a chapter number of Which Chapter in the Table of Chapter-Heading Quotes;
say the witty quote;
repeat with X running from 1 to 4 begin;
say paragraph break;
end repeat.
Table of Chapter-Heading Quotes
Chapter Number Quote
1 "They seem close, the stars, but they're[line break]far away. Their light is millions,[line break]billions of years out of date. Messages[line break]with no sender.[line break][fixed letter spacing] [roman type]-- Margaret Atwood, [italic type]Oryx and Crake[roman type]"
When play begins, print a title page for chapter 1.
The empty room is a room.
… but no matter how I futz around with it, Inform strips the spaces at the beginning of each line. Weirdly, though, the attribution line is indented, just as I wanted it to be.
What am I missing here? It seems like it should be an easy thing to do.
Good news: It’s not stripping spaces. (The littlest detail: You missed “quotedly
” at the start of your “say the witty quote
” statement in the to print a/-- title page for chapter ...
phrase.)
Bad news: The extra spaces and special formatting of the last line of the quote are lost – perhaps a side effect of the [line number N in...]
substitution?
You might get some mileage out of one of the phrases posted in this topic: Indents in text
1 Like
-facepalm-
It’s always something simple, but not in the direction I’m looking. Sigh. Thank you. Of course that was the problem. (And a lesson on whether it’s a good idea to define new say-phrases that include the word say
, for that matter.)
I bet that’s it – section 20.3 of Writing with Inform is careful to say that the routines described in it (including line number N in ...
) work character by character, line by line, etc., and doesn’t make any mention at all of passing say-phrases or other text substitutions through. It also strips out the italic text from the name of the novel, though, so that seems very plausible.
Not a problem, though! It’s easy enough to just handle the attribution separately, without invoking quotedly say
, by making the attribution a separate column in the table:
To quotedly say (witty saying - some text):
repeat with line_no running from 1 to the number of lines in the witty saying:
say "[fixed letter spacing] [variable letter spacing][line number line_no in the witty saying][line break]"
To print a/the/-- title page for chapter (Which Chapter - a number):
say "[italic type](Press any key to continue.)[roman type][paragraph break]";
wait for any key;
repeat with X running from 1 to 10 begin;
say paragraph break;
end repeat;
let the witty quote be the quote corresponding to a chapter number of Which Chapter in the Table of Chapter-Heading Quotes;
let the grateful attribution be the attribution corresponding to a chapter number of Which Chapter in the Table of Chapter-Heading Quotes;
quotedly say the witty quote;
say "[fixed letter spacing] [variable letter spacing]-- [the grateful attribution]";
repeat with X running from 1 to 4 begin;
say paragraph break;
end repeat.
Table of Chapter-Heading Quotes
Chapter Number Quote Attribution
1 "They seem close, the stars, but they're[line break]far away. Their light is millions,[line break]billions of years out of date. Messages[line break]with no sender.[line break]" "[fixed letter spacing][roman type]Margaret Atwood, [italic type]Oryx and Crake[roman type]"
Thanks again for your help!
Believe me: I know the feeling!
1 Like
You’d think that, after squashing about a trillion bugs in half a dozen languages since my grandparents bought my family a Radio Shack Color Computer 2 in the mid-eighties, I’d’ve anticipated it, but apparently not. Sigh.