1
<HTML><HEAD><TITLE>Section 6: All the Inform error messages</TITLE></HEAD>
2
<BODY BGCOLOR="#FFFFFF">
4
<TR><TD Valign="top"><A HREF="contents.html">Contents</A><BR><A HREF="section5.html">Back</A><BR><A HREF="chapter3.html">Forward</A><TD bgcolor="#F5DEB3"><BLOCKQUOTE><H3>6. All the Inform error messages</H3></BLOCKQUOTE><TR><TD><TD>
5
Three kinds of error are reported by Inform: a fatal error is a breakdown
6
severe enough to make Inform stop working at once; an error allows Inform
7
to continue for the time being, but will cause Inform not to finally output
8
the story file (this is to prevent damaged story files being created); and
9
a warning means that Inform suspects you may have made a mistake, but will
10
not take any action itself.
13
<BLOCKQUOTE><H4>Fatal errors</H4></BLOCKQUOTE><P>
16
<P> 1. <I> Too many errors</I>
18
Too many errors: giving up
21
After 100 errors, Inform stops (in case it has been given the wrong source file
22
altogether, such as a program for a different language altogether).
25
<P> 2. <I> Input/output problems</I>
26
<P> Most commonly, Inform has the wrong filename:
28
Couldn't open input file <filename>
29
Couldn't open output file <filename>
32
(and so on). More seriously the whole process of file input/output (or "I/O'')
33
may go wrong for some reason to do with the host computer: for instance, if it
34
runs out of disc space. Such errors are rare and look like this:
36
I/O failure: couldn't read from temporary file 2
39
Normally you can only have at most 64 files of source code in a single
40
compilation. If this limit is passed, Inform generates the error
42
Program contains too many source files: increase #define MAX_SOURCE_FILES
45
(This might happen if the same file accidentally <TT>Include</TT>s itself.) Finally,
46
if a non-existent pathname variable is set in ICL, the error
48
No such path setting as <name>
54
<P> 3. <I> Running out of memory</I>
55
<P> If there is not enough memory even to get started,
58
Run out of memory allocating <number> bytes for <something>
59
Run out of memory allocating array of <number>x<number> bytes for <something>
62
(There are four similar <TT>hallocate</TT> errors unique to the PC 'Quick C' port.)
63
More often memory will run out in the course of compilation, like so:
65
The memory setting <setting> (which is <value> at present) has been exceeded.
66
Try running Inform again with $<setting>=<some-larger-number> on the command line.
69
(For details of memory settings, see <A HREF="section5.html">Section 5</A> above.) In a really colossal game,
70
it is just conceivable that you might hit
72
One of the memory blocks has exceeded 640K
75
which would need Inform to be recompiled to get around (but I do not expect
76
anyone ever to have this trouble). Much more likely is the error
78
The story file/module exceeds version <n> limit (<number>K) by <number> bytes
81
If you're already using version 8, then the story file is full: you might be
82
able to squeeze more game in using the <TT>Abbreviate</TT> directive, but basically
83
you're near to the maximum game size possible. Otherwise, the error suggests
84
that you might want to change the version from 5 to 8, and the game will be
85
able to grow at least twice as large again.
89
<BLOCKQUOTE><H4>Errors</H4></BLOCKQUOTE><P>
90
There are a few conventions. Anything in double-quotes is a quotation from
91
your source code; other strings are in single-quotes. The most common error
94
Expected ... but found ...
97
(of which there are over 100 kinds): most are straightforward to sort out,
98
but a few take some practice. One of the trickiest things to diagnose is
99
a loop statement having been misspelt. For example, the lines
102
While (x==y) print "x is still y^";
105
produce one error each:
107
line 1: Error: Expected assignment or statement but found pritn
108
line 2: Error: Expected ';' but found print
111
The first is fine. The second is odd: a human immediately sees that
112
<TT>While</TT> is meant to be a <TT>while</TT> loop, but Inform is not able to make
113
textual guesses like this. Instead Inform decides that the code intended was
115
While (x==y); print "x is still y^";
118
with <TT>While</TT> assumed to be the name of a function which hasn't been declared yet.
119
Thus, Inform thinks the mistake is that the <TT>;</TT> has been missed out.
122
In that example, Inform repaired the situation and was able to carry on as normal
123
in subsequent lines. But it sometimes happens that a whole cascade of errors
124
is thrown up, in code which the user is fairly sure must be nearly right. What
125
has happened is that one syntax mistake threw Inform off the right track, so that
126
it continued not to know where it was for many lines in a row. Look at the first
127
error message, fix that and then try again.
130
<P> 1. <I> Reading in the source-code</I>
132
Illegal character found in source: (char) <hexadecimal number>
133
Unrecognised combination in source: <text>
134
Alphabetic character expected after <text>
135
No such accented character as <text>
136
Name exceeds the maximum length of <number> characters: <name>
137
The following name is reserved by Inform for its own use as a routine name;
138
you can use it as a routine name yourself (to override the standard
139
definition) but cannot use it for anything else: <name>
140
The obsolete '#w$word' construct has been removed
141
Binary number expected after '$$'
142
Hexadecimal number expected after '$'
143
Too much text for one pair of 's to hold
144
Too much text for one pair of "s to hold
147
Note that, for instance, a <TT>^</TT> character is illegal in ordinary source
148
code (producing the first error above), but is allowed within quotation
152
<P> 2. <I> Variables and arrays</I>
154
Variable must be defined before use: <name>
155
'=' applied to undeclared variable
156
Local variable defined twice: <name>
157
All 236 global variables already declared
158
No array size or initial values given
159
Array sizes must be known now, not externally defined
160
An array must have a positive number of entries
161
A 'string' array can have at most 256 entries
162
Entries in byte arrays and strings must be known constants
163
Missing ';' to end the initial array values before "[" or "]"
166
The limit of 236 global variables is absolute: a program even approaching this
167
limit should probably be making more use of object properties to store its
168
information. "Entries... must be known constants'' is a restriction on what
169
byte or string arrays may contain: basically, numbers or characters; defined
170
constants (such as object names) may only be used if they have already been
171
defined. This restriction does not apply to the more normally used word and
175
<P> 3. <I> Routines and function calls</I>
177
No 'Main' routine has been defined
178
It is illegal to nest routines using '#['
179
A routine can have at most 15 local variables
180
Argument to system function missing
181
System function given with too many arguments
182
Only constants can be used as possible 'random' results
183
A function may be called with at most 7 arguments
184
Duplicate definition of label: <name>
187
Note that the system function <TT>random</TT>, when it takes more than one
188
argument, can only take constant arguments (this enables the possibilities
189
to be stored efficiently within the program). Thus
190
<TT>random(random(10), location)</TT> will produce an error. To make a
191
random choice between non-constant values, write a <TT>switch</TT> statement instead.
194
<P> 4. <I> Expressions and arithmetic</I>
196
Missing operator: inserting '+'
197
Evaluating this has no effect: <operator>
198
'=' applied to <operator>
199
Brackets mandatory to clarify order of: <operator>
200
Missing operand for <operator>
201
Missing operand after <something>
202
Found '(' without matching ')'
203
No expression between brackets '(' and ')'
205
Division of constant by zero
206
Label name used as value: <name>
207
System function name used as value: <name>
208
No such constant as <name>
211
"Operators'' include not only addition <TT>+</TT>, multiplication <TT>*</TT> and so on,
212
but also more exotic Inform constructs like <TT>--></TT> ("array entry'') and
213
<TT>.</TT> ("property value''). An example of an operator where "Evaluating
214
this has no effect'' is in the statement
219
where the multiplication is a waste of time, since nothing is done with the
220
result. "<I>=</I> applied to operator'' means something like
225
which literally means "set $4/$<TT>fish</TT> to 7'' and results in the error
226
"<I>=</I> applied to <I>/</I>''.
229
"Brackets mandatory to clarify order'' means that an ambiguous expression
232
frogs == ducks == geese
235
requires clarification: which <TT>==</TT> is to be worked out first?
238
<P> 5. <I> Miscellaneous errors in statements</I>
240
'do' without matching 'until'
241
'default' without matching 'switch'
242
'else' without matching 'if'
243
'until' without matching 'do'
244
'break' can only be used in a loop or 'switch' block
245
At most 32 values can be given in a single 'switch' case
246
Multiple 'default' clauses defined in same 'switch'
247
'default' must be the last 'switch' case
248
'continue' can only be used in a loop block
249
A reserved word was used as a print specification: <name>
250
No lines of text given for 'box' display
251
In Version 3 no status-line drawing routine can be given
252
The 'style' statement cannot be used for Version 3 games
255
For instance, <TT>print (fixed) X</TT> gives the "reserved word in print
256
specification'' error because <TT>fixed</TT> is a reserved statement internal
257
keyword. Anyway, call such a printing routine something else.
260
<P> 6. <I> Object and class declarations</I>
262
Two textual short names given for only one object
263
The syntax '->' is only used as an alternative to 'Nearby'
264
Use of '->' (or 'Nearby') clashes with giving a parent
265
'->' (or 'Nearby') fails because there is no previous object
266
'-> -> ...' fails because no previous object is deep enough
267
Two commas ',' in a row in object/class definition
268
Object/class definition finishes with ','
269
Not an individual property name: <name>
270
No such property name as <name>
271
Not a (common) property name: <name>
272
Property should be declared in 'with', not 'private': <name>
273
Limit (of 32 values) exceeded for property <name>
274
Duplicate-number not known at compile time
275
The number of duplicates must be 1 to 10000
278
Note that "common properties'' (those provided by the library,
279
or those declared with <TT>Property</TT>) cannot be made <TT>private</TT>.
280
All other properties are called "individual''. The "number
281
of duplicates'' referred to is the number of duplicate instances
282
to make for a new class, and it needs to be a number Inform can
283
determine now, not later on in the source code (or in another
284
module altogether). The limit 10000 is arbitrary and imposed to
285
help prevent accidents.
288
<P> 7. <I> Grammar</I>
290
Two different verb definitions refer to <name>
291
There is no previous grammar for the verb <name>
292
There is no action routine called <name>
293
No such grammar token as <text>
294
'=' is only legal here as 'noun=Routine'
295
Not an action routine: <name>
296
This is a fake action, not a real one: <name>
297
Too many lines of grammar for verb: increase #define MAX_LINES_PER_VERB
300
At present verbs are limited to 20 grammar lines each, though this
301
would be easy to increase. (A grammar of this kind of length
302
can probably be written more efficiently using general parsing
306
<P> 8. <I> Conditional compilation</I>
308
'Ifnot' without matching 'If...'
309
Second 'Ifnot' for the same 'If...' condition
310
End of file reached in code 'If...'d out
311
This condition can't be determined
314
"Condition can't be determined'' only arises for <TT>Iftrue</TT>
315
and <TT>Iffalse</TT>, which make numerical or logical tests: for instance,
317
Iftrue #strings_offset==$4a50;
320
can't be determined because even though both quantities are
321
constants, the <TT>#strings_offset</TT> will not be known until compilation
322
is finished. On the other hand, for example,
324
Iftrue #version_number>5;
327
can be determined, as the version number was set before compilation.
330
<P> 9. <I> Miscellaneous errors in directives</I>
332
You can't 'Replace' a system function already used
333
Must specify 0 to 3 local variables for 'Stub' routine
334
A 'Switches' directive must come before the first constant definition
335
All 48 attributes already declared
336
All 62 properties already declared
337
'alias' incompatible with 'additive'
338
The serial number must be a 6-digit date in double-quotes
339
A definite value must be given as release number
340
A definite value must be given as version number
341
The version number must be in the range 3 to 8
342
All 64 abbreviations already declared
343
All abbreviations must be declared together
344
It's not worth abbreviating <text>
345
'Default' cannot be used in -M (Module) mode
346
'LowString' cannot be used in -M (Module) mode
350
<P> 10. <I> Linking and importing</I>
352
File isn't a module: <name>
353
Link: action name clash with <name>
354
Link: program and module give differing values of <name>
355
Link: module (wrongly) declared this a variable: <name>
356
Link: this attribute is undeclared within module: <name>
357
Link: this property is undeclared within module: <name>
358
Link: this was referred to as a constant, but isn't: <name>
359
Link: <type> <name> in both program and module
360
Link: <name> has type <type> in program but type <type> in module
361
Link: failed because too many extra global variables needed
362
Link: module (wrongly) declared this a variable: <name>
363
Link: this attribute is undeclared within module: <name>
364
Link: this property is undeclared within module: <name>
365
Link: this was referred to as a constant, but isn't: <name>
366
'Import' cannot import things of this type: <name>
367
'Import' can only be used in -M (Module) mode
370
Note that the errors beginning "Link:'' are exactly those occurring
371
during the process of linking a module into the current compilation.
372
They mostly arise when the same name is used for one purpose in the
373
current program, and a different one in the module.
376
<P> 11. <I> Assembly language</I>
378
Label out of range for branch
379
Opcode specification should have form "VAR:102"
380
Unknown flag: options are B (branch), S (store),
381
T (text), I (indirect addressing), F** (set this Flags 2 bit)
382
Only one '->' store destination can be given
383
Only one '?' branch destination can be given
384
No assembly instruction may have more than 8 operands
385
This opcode does not use indirect addressing
386
Indirect addressing can only be used on the first operand
387
Store destination (the last operand) is not a variable
388
Opcode unavailable in this Z-machine version: <name>
389
Assembly mistake: syntax is <syntax>
390
Routine contains no such label as <name>
391
For this operand type, opcode number must be in range <range>
395
<P> 12. <I> None of the above</I>
396
<P> If you should see an incomprehensible error
397
message beginning with <TT>***</TT>, then Inform itself has malfunctioned.
398
This is not meant to happen, but it's conceivable that it might occur
399
in the process of linking in a module which has been damaged in some way.
402
Finally, error messages can also be produced from within the program
403
(deliberately) using <TT>Message</TT>. It may be that a mysterious message
404
is being caused by an included file written by someone other than yourself.
408
<BLOCKQUOTE><H4>Warnings</H4></BLOCKQUOTE><P>
409
<P> 1. <I> Questionable practices</I>
411
This statement can never be reached
414
There is no way that the statement being compiled can ever be executed when the
415
game is played. Here is an obvious example:
417
return; print "Goodbye!";
420
where the <TT>print</TT> statement can never be reached, because a <TT>return</TT> must just
421
have happened. Beginners often run into this example:
423
"You pick up the gauntlet."; score=score+1; return;
426
Here the <TT>score=score+1</TT> statement is never reached because the text, given on
427
its own, means "print this, then print a new-line, then return from the current
428
routine''. The intended behaviour needs something like
430
print "You pick up the gauntlet.^"; score=score+1; return;
435
<type> <name> declared but not used
438
For example, a <TT>Global</TT> directive was used to create a variable, which was then
439
never used in the program.
441
'=' used as condition: '==' intended?
446
if (x = 5) print "My name is Alan Partridge.";
450
is legal, it's probably a mistake: <TT>x=5</TT> sets <TT>x</TT> to 5 and results in 5, so the
451
condition is always true. Presumably it was a mistype for <TT>x==5</TT> meaning "test
452
<TT>x</TT> to see if it's equal to 5''.
454
Unlike C, Inform uses ':' to divide parts of a 'for' loop
455
specification: replacing ';' with ':'
458
Programmers used to the C language will now and then habitually type a <TT>for</TT>
461
for (i=0; i<10; i++) ...
465
but Inform needs colons, not semicolons: however, as it can see what was intended,
466
it makes the correction automatically and issues only a warning.
468
Missing ','? Property data seems to contain the property name <name>
471
The following, part of an object declaration, is legal but unlikely:
473
with found_in MarbleHall
474
short_name "conch shell", name "conch" "shell",
477
As written, the <TT>found_in</TT> property has a list of three values: <TT>MarbleHall</TT>,
478
<TT>short_name</TT> and <TT>"conch shell"</TT>. <TT>short_name</TT> throws up the warning because
479
Inform suspects that a comma was missed out and the programmer intended
481
with found_in MarbleHall,
482
short_name "conch shell", name "conch" "shell",
485
This is not a declared Attribute: <name>
488
Similarly, suppose that a game contains a <TT>pen</TT>. Then the following <TT>give</TT>
489
statement is dubious but legal:
491
give MarbleDoorway pen;
494
The warning is caused because it's far more likely to be a misprint for
496
give MarbleDoorway open;
499
Without bracketing, the minus sign '-' is ambiguous
504
Array Doubtful --> 50 10 -20 56;
508
because Inform is not sure whether this contains three entries, the middle one
509
being $10-20=-10$, or four. It guesses four, but suggests brackets to clarify
512
Array entry too large for a byte
515
Byte <TT>-></TT> and <TT>string</TT> arrays can only hold numbers in the range 0 to 255.
516
If a larger entry is supplied, only the remainder mod 256 is stored, and this
519
Verb disagrees with previous verbs: <verb>
522
The <TT>Extend only</TT> directive is used to cleave off a set of synonymous English
523
verbs and make them into a new Inform verb. For instance, ordinarily "take'',
524
"get'', "carry'' and "hold'' are one single Inform verb, but this directive
525
could split off "carry'' and "get'' from the other two. The warning would
526
arise if one tried to split off "take'' and "drop'' together, which come from
527
different original Inform verbs. (It's still conceivably usable, which is why
528
it's a warning, not an error.)
530
This does not set the final game's statusline
533
An attempt to choose, e.g., <TT>Statusline time</TT> within a module, having no effect
534
on the program into which the module will one day be linked. Futile.
536
This module has a more advanced format than this release of the
537
Inform 6 compiler knows about: it may not link in correctly
541
<P> 2. <I> Obsolete usages</I>
543
more modern to use 'Array', not 'Global'
544
use '->' instead of 'data'
545
use '->' instead of 'initial'
546
use '->' instead of 'initstr'
547
use 'word' as a constant dictionary address
548
'#a$Act' is now superceded by '##Act'
549
'#n$word' is now superceded by ''word''
550
'#r$Routine' can now be written just 'Routine'
551
all properties are now automatically 'long'
552
use the ^ character for the apostrophe in <dictionary word>
555
These all occur if Inform compiles a syntax which was correct under Inform
556
5 (or earlier) but has now been withdrawn in favour of something better.
559
<P><TR><TD Valign="top"><IMG SRC="icons/ddbend.gif" ALT="/\/\"><TD bgcolor="#EEEEEE"><SMALL> No Inform library file (or any other file marked <TT>System_file</TT>)
560
produces warning messages. It may contain many declared but unused routines,
561
or may contain obsolete usages for the sake of backward
564
<HR><A HREF="contents.html">Contents</A> / <A HREF="section5.html">Back</A> / <A HREF="chapter3.html">Forward</A> <BR>
565
<A HREF="chapter1.html">Chapter I</A> / <A HREF="chapter2.html">Chapter II</A> / <A HREF="chapter3.html">Chapter III</A> / <A HREF="chapter4.html">Chapter IV</A> / <A HREF="chapter5.html">Chapter V</A> / <A HREF="chapter6.html">Chapter VI</A> / <A HREF="chapterA.html">Appendix</A><HR><SMALL><I>Mechanically translated to HTML from third edition as revised 16 May 1997. Copyright © Graham Nelson 1993, 1994, 1995, 1996, 1997: all rights reserved.</I></SMALL></BODY></HTML>