Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000474Core InformRules and rulebookspublic2010-12-18 19:112014-05-07 07:35
ReporterPoster 
Assigned Tograham 
PrioritynormalSeveritycosmeticReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSMac OS XOS Version10.5
Product Version6F95 
Target VersionFixed in Version6L02 
Summary0000474: Unhelpful error message when using if statement incorrectly
DescriptionIf you use an if statement wrongly, you get an error message that leads you on a wild goose chase. The problem is not that you are trying to assign a value to anything, it's that the if statement cannot be used alone.

A better error message would be something like: "You wrote 'If player is in Kitchen, say "Hi."' : but it looks like you are trying to create a rule or enforce a condition without declaring a rule in a way that I understand. You can use rule verbs like before, instead, or after; alternately, you can create a rule within a rulebook."

Problem. You wrote 'If player is in Kitchen, say "Hi."' : but this seems to give something a name which contains double-quoted text, which is not allowed. If you do need quotes in a name, one option would be to write something like 'In the Saloon is 'Black' Jacques Bernoulli.'; but this problem message is often caused by an accident in punctuation, in which case you never intended to create an object - you thought that the text ended a sentence because it finished with sentence-ending punctuation, when in fact it didn't, so that I read the next words as following on.

Minimal Source Text To Reproduce
"test"

Kitchen is a room.

If player is in Kitchen, say "Hi."
TagsNo tags attached.
Effect(cosmetic) Error message is badly worded
Attached Files

- Relationships
related to 0000451closedgraham Blank line in rule causes unhelpful errors 
has duplicate 0001220closedgraham Misleading problem messages when if phrases are used outside of rules. 
related to 0000475closedgraham Unhelpful error message when using verbs incorrectly. 

-  Notes
(0001395)
graham (administrator)
2011-10-16 07:02

This sentence, however, is legal:

If DVD is in the Library.

and creates an object (Lindsay Anderson's movie, presumably) and a room, putting one in the other. The problem with the source text was not that a sentence began with "if", it was the problem reported by Inform.

It's arguable that we should leave things as they are, but I've added a footnote to problem messages like this one in cases where control structures appear in assertion sentences known to be erroneous:

>--> The way this sentence starts makes me think it might have been intended as part of a rule rather than being a statement about the the way things are at the beginning of play. For example, 'If the player is in the Penalty Zone, say "An alarm sounds." is not allowed: it has to be put in the form of a rule showing Inform what circumstances apply - for example 'Every turn: if the player is in the Penalty Zone, say "An alarm sounds."

- Issue History
Date Modified Username Field Change
2010-12-18 19:11 Poster New Issue
2010-12-19 00:02 jmcgrew Relationship added related to 0000451
2010-12-19 00:03 jmcgrew Status new => confirmed
2010-12-19 00:04 jmcgrew Relationship added child of 0000475
2010-12-19 00:04 jmcgrew Relationship deleted child of 0000475
2010-12-19 00:04 jmcgrew Relationship added related to 0000475
2011-10-16 07:02 graham Note Added: 0001395
2011-10-16 07:02 graham Status confirmed => resolved
2011-10-16 07:02 graham Resolution open => fixed
2011-10-16 07:02 graham Assigned To => graham
2014-04-14 11:07 EmacsUser Relationship added has duplicate 0001220
2014-05-07 07:34 jmcgrew Fixed in Version => 6L02
2014-05-07 07:35 jmcgrew Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker