Inform 7: Question about values

I’m trying to make an oven with a temperature knob that can be set, but in the check code for turning the dial I get an error message.

Here’s the code:

The oven_dial is part of the oven. Understand "dial" as the oven_dial. The oven_dial has a number called current setting. The current setting of the oven_dial is 100. The oven_dial has a number called min setting. The min setting of the oven_dial is 100. The oven_dial has a number called max setting. The max setting of the oven_dial is 500. The description of the dial is "The oven dial can be set from [min setting of the oven_dial] to [max setting of the oven_dial] degrees Fahrenheit. At the moment it's set to [current setting of the oven_dial]."
Instead of turning the oven_dial:
say "You have to specify a number to turn it to."
Setting the state of it to is an action applying to one thing and one number. Understand "turn [something] to [number]" or "set [something] to [number]" or "adjust [something] to [number]" or "put [something] at [number]" or "heat [something] to [number]" or "crank [something] to [number]" as setting the state of it to.
Check setting the state of it to:
if the noun is not the oven_dial or the noun is not the oven, say "You can't set [the noun] to a number." instead;
if the noun is the oven, now the noun is the oven_dial;
if the noun is the oven_dial:

	if the number understood < min setting of the oven_dial:
	
		instead: say "The lowest setting is [min setting of the oven_dial] degrees.";

	if the number understood > max setting of the oven_dial:
	
		instead: say "Sorry, the dial can only be set from [min setting of the oven_dial] to [max setting of the oven_dial] degrees.".

Carry out setting the state of it to:
now the current setting of the noun is the number understood;
say "You set the oven temperature to [number understood]."

The two lines that look like ‘if the number understood < min setting of the oven_dial’ generate the error message:

You wrote ‘if the number understood < min setting of the oven_dial’ : but this is a kind of value which already has a semi-numerical specification, so it can’t have an entirely verbal form as well.

How can I fix this?

Are those blank lines really in your source code? You can’t have blank lines in the middle of a rule — it doesn’t work. Looks like you’ve got 4 of them in the middle of your Check rule there. When you skip a line where you shouldn’t, I’ve found that Inform tends to reject the first line following the skipped line, so maybe that is what’s happening here.

Paul.

EDIT: P.S. Also, I don’t think you can use colons after your ‘instead’ like that (I mean within your Check rule) – rather than ‘instead: say’ I think it should just be ‘instead say’…

Ok. I had it formatted differently at first, but when I got a bunch of error messages I changed the formatting, and since most of the messages disappeared, I thought I had fixed it. :blush: When I tried what you said, it worked. Thanks!

Oh, no worries. That skipped line thing has tripped me up already many times, and every time it’s happened, I stared at the error message and at my code for 10 or 15 minutes wondering WTF was Inform talking about — I guess I finally learned! 87

The only other bug that has stumped me as often is this thing where after "Currency is a kind of value. $1.99 specifies a currency with parts dollars and cents. X is a currency variable.’ Inform will accept ‘X is the currency with dollars part 19 cents part 99.’ but it won’t accept ‘X is a currency with dollars part 19 cents part 99.’ — much like with whitespace, Inform doesn’t care whether you type ‘a’ and ‘the’ except in a few circumstances, and that gets me, every time, I will tend to just stare and stare at those ‘errors’ and see nothing wrong.

P.