I’d like to print the topic for Read/Consult, but can’t figure out how to do this.
There was a post about this at Ask: with several words , but either that solution no longer works or I’m doing something wrong in my program.
Here’s my code:
Object -> MonkGuide "The History of the Monks of Our Lady of Thorns",
class AdjObject,
with
adj_name 'monks',
noun_name 'history' 'book',
description "A small book listing the monks who have served in the priory,
along with some information on them.",
before [ i ;
Consult:
if (second == nothing) {
print "cf=", consult_from, ", cw=", consult_Words, "^";
print "You find no entry for ~";
for(i = 0 : i < consult_words : i++) {
print (address) WordValue(consult_from + i), " ";
}
"~ in ", (the) self, ".";
}
print_ret (string) second.history_text, "^";
],
has
proper;
The debug for cw= and cf= print sane values given the input “read about foo bar baz in book”, but it prints total junk.
The drawback is that any dictionary words are then truncated to the first n characters, where n is between 1 and 9, depending on Z-code version, custom alphabet table (if any), and the specific characters of the word.