Dealing with empty topic understood

I’ve got lots of talking in my IF, and it’s easy for the player to accidentally hit the enter key too early. The problem is this means there’s no topic understood, and the parser throws a wobbly and says “*** run-time problem p39: attempt to say a snippet value which is currently invalid: words 3 to 2.” Which I have absolute sympathy with, but I have no idea how to fix it.

[code]The Stage is a room. Jeff is a man in the Stage.

Instead of answering someone that something:
say “’[topic understood in sentence case],’ you say.”

Test me with “jeff, hello/jeff,”[/code]
I tried “Instead of answering someone that nothing”, and I tried “if topic understood is not blank/empty/invalid/”", but none of my attempts are any more valid than the topic understood. Help?

You can catch that empty snippet like this:

The Stage is a room. Jeff is a man in the Stage. The hurdy gurdy man is a man in the Stage.

Instead of answering someone that something:
	unless the remainder after dividing the number understood by 100 is 0:
		say "'[topic understood in sentence case],' you say.";
	otherwise:
		say "But you didn't say anything to [the noun]."
   
Test me with "jeff, do me a favour / jeff, / hurdy gurdy man, hi / hurdy gurdy, "

Inform internally represents snippets by numbers where the hundreds tell Inform with which word in the player’s command the snippet starts and the units telling it how many words long the snippet is.

So, in “Jeff, hello”, the entire player’s command is the snippet represented by 103 (meaning the snippet begins with the first word and is 3 words long (the comma counts as one word)); 202 would be the snippet “, hello”; and the topic understood will in this case be represented by the number 301 (“hello” being the third word in the command and only 1 word long).

In the defective command "Jeff, " the topic understood is represented by the number 300 – meaning it begins with the third word, which doesn’t exist and therefore is 0 words long. In general we want to catch snippets that are 0 words long wherever they (fail to) start in the player’s command; so we check for snippets represented as even hundreds.

You can’t use “topic understood” in the condition, since Inform 7 itself does not recognize that as a number variable; however, “number understood” and “topic understood” are actually two different names for the same Inform 6 variable, the one where the snippet/number is stored, so we can use “number understood” instead.

Awesome, thank you!