Parsing question

It’s funny how I seem to be able to do the complicated things in inform7 with little fuss, but, as a newbie still, get stuck on the things that ought to be simple. Oh well. Sorry, but dumb question follows.

Following code:

[code]Understand the command “set” as something new.

Setting the state to is an action applying to one thing and one number.

Understand “set [something] to [number]” as setting the state to.

Check setting the state to:
if the noun is the dial:
if the number understood < min setting of the dial:
instead say “The lowest setting is [min setting of the dial].”;
if the number understood > max setting of the dial:
instead say “Sorry, the dial can only be set from [min setting of the dial] to [max setting of the dial].”.

Carry out setting the state to:
if the noun is the dial:
now the minute of the noun is the number understood;
say “You set the dial to [number understood].”;

[/code]
That all works fine. But.

Here’s the really simple (and probably obvious question) How do I get it to pre-check that the second part is, in fact a number? And give a message to that effect. I’ve tried everything I can think of and it will only return the bog standard:

set dial to sometext
I didn’t understand that number.

McT

The easiest way is “understand … as a mistake”:

Understand "set [something] to [text]" as a mistake ("You can only set things to a number.")

As a side note, things will be easier if you rename your action to “setting the state of it to” or something similar with “it” signifying where the noun goes. That way you can write rules like “Carry out setting the state of the dial to:” instead of always checking the noun separately.

Thank you! Of course! (I did say it was going to be obvious!)

if you rename your action to “setting the state of it to”
Interestingly, the action started out as this. However, it wouldn’t compile so I had to change it.
[url]new action acting fast problem]

It can be a tricky because sometimes it needs “it” and sometimes “something” (“it” only in action and grammar definitions), but this compiles:

Understand the command "set" as something new.

Setting the state of it to is an action applying to one thing and one number. 

Understand "set [something] to [number]" as setting the state of it to.

Check setting the state of the dial to:
	if the number understood < min setting of the dial:
		instead say "The lowest setting is [min setting of the dial]."; 
	if the number understood > max setting of the dial: 
		instead say "Sorry, the dial can only be set from [min setting of the dial] to [max setting of the dial].".

Carry out setting the state of the dial to:
	now the minute of the noun is the number understood;
	say "You set the dial to [number understood].";

You can also just leave the old definition of “set” in; a number is more specific than a topic, so your action will be called first.

Then use something like this:

Check setting the dial to a topic: say "The dial has only numbers on it" instead.

This way you can have some things in your game which use the old setting action if necessary.