Here's an example. In trying to run "Odyssey" (Ex. 259 in the Inform 7
Recipe Book),
the part Inform seems to highlight is this:
Every turn when Athena is active:
repeat through the Table of Athena's Movement:
let last space be the location of Athena;
The error when translating the source returns from I7 as:
Problem. The phrase or rule definition 'Every turn when Athena is
active' is written using the 'colon and indentation' syntax for its
'if's, 'repeat's and 'while's, where blocks of phrases grouped
together are indented one tab step inward from the 'if ...:' or
similar phrase to which they belong. But the tabs here seem to be
misaligned, and I can't determine the structure. The first phrase
going awry in the definition seems to be 'let last space be the
location of Athena' , in case that helps.
This sometimes happens even when the code looks about right, to the
eye, if rows of spaces have been used to indent phrases instead of
tabs.
I had a similar problem with the following example files:
Succession
Pages (In 16.9. Understanding kinds of value)
In trying to overcome these kinds of errors, I tried all kinds of
different spacing and using a tabbed space, 2x tabbed spaces, 4
spaces, aligning everything according to the look of the examples
manually after deleting all the spaces and tabs out, etc. and I'm
still coming up with the same errors. Also, I am using the
documentation in the IF program and not what's on the Web-site as
what's in the program is supposed to be more up to date or so I've
heard.
If anyone has encountered a similar problem or may be able to shed
some light on why this is occurring, I would greatly appreciate it.
Thanks,
Zero
> Hello again, everyone. This post references some very specific example
> files from the documentation and the recipe book for Inform 7. In
> trying to get the example files to work whenever they contain the
> Every turn when /repeat through or random number directive, it won't
> compile. [I can't remember any specific examples with the random
> number issue right now] The error usually centers around the first two
> lines of the Every turn when /repeat through part.
>
> Here's an example. In trying to run "Odyssey" (Ex. 259 in the Inform 7
> Recipe Book),
>
> the part Inform seems to highlight is this:
> Every turn when Athena is active:
> repeat through the Table of Athena's Movement:
> let last space be the location of Athena;
>
The last line needs to be indented with a tab (I've used spaces here,
because of the way newsgroup posting can mangle indentation):
<code>
Every turn when Athena is active:
repeat through the Table of Athena's Movement:
let last space be the location of Athena;
</code>
This tells Inform that the last line (and whatever you clipped after it)
are part of the "repeat" loop initiated in the line above.
--Erik
Hello, there. Yes, I'm using windows. I made the changes suggested
above by Erik, but the errors are still happening(with 5 or 6 spaces
before repeat and the let line indented with a tab).
[Copied and pasted below]
Every turn when Athena is active:
repeat through the Table of Athena's Movement:
let last space be the location of Athena;
if Athena can be seen by the player, say "Athena heads to [the
destination entry].";
move Athena to destination entry;
if Athena can be seen by the player, say "Athena arrives from
[the last space].";
blank out the whole row;
rule succeeds.
Also, similar errors are happening with the "Generation X" example
file, but I'll feel like I'm making progress if I could at least get
the "Odyssey" to work. Is there some bug in Windows perhaps? I'm using
Windows VISTA. Do I need to set my tab space to something different in
Inform, and if so, how?
Thanks,
Zero
Error:
The phrase or rule definition 'Every turn when Athena is active' is
written using the 'colon and indentation' syntax for its 'if's,
'repeat's and 'while's, where blocks of phrases grouped together are
indented one tab step inward from the 'if ...:' or similar phrase to
which they belong. But the phrase 'repeat through the Table of
Athena's Movement' , which ought to begin a block, is immediately
followed by 'let last space be the location of Athena' at the same
or a lower indentation, so the block seems to be empty - this must
mean there has been a mistake in indenting the phrases.
--------------------------------------------------------------------------------
Problem. The phrase or rule definition 'Every turn when Athena is
active' is written using the 'colon and indentation' syntax for its
'if's, 'repeat's and 'while's, where blocks of phrases grouped
together are indented one tab step inward from the 'if ...:' or
similar phrase to which they belong. But the tabs here seem to be
misaligned, and I can't determine the structure. The first phrase
going awry in the definition seems to be 'repeat through the Table of
Athena's Movement' , in case that helps.
Erik,
Thanks for responding along with Tatiana. Something still isn't
allowing these kind of example files to work. If anyone has any
suggestions, they would be greatly appreciated. Thanks.
> On Jan 7, 5:36 pm, Tatiana <tatmasl...@yahoo.com> wrote:
>> Are you using Windows? When I paste the examples you mention, I have
>> no problems compiling.
>
> Hello, there. Yes, I'm using windows. I made the changes suggested
> above by Erik, but the errors are still happening(with 5 or 6 spaces
> before repeat and the let line indented with a tab).
Ah, I wasn't clear enough about the changes that need to be made. The
problem is that both newsgroups and Inform's pasting mechanism can screw
up tabs, in different ways. Anyway, I see what your problem is more
clearly now. Inform's problems pasting back and forth between the
documentation and the source code are a limitation of HTML (the docs are
in HTML), which doesn't have a concept of a tab character.
Short solution:
Each example has a little icon next to it that you are intended to use to
paste it to the source pane. Just press this button and the source should
be pasted without issues. If you manually cut and paste, spaces will be
used to render the tabs, and in most cases this will not work.
Longer solution:
Inform needs actual tabs, not spaces, in code blocks of this kind.
(There's another way to do it that's more verbose and doesn't care about
white space; you can check the documentation to find this if you like.)
So, the code should look like this:
Every turn when Athena is active:
[tab]repeat through the Table of Athena's Movement:
[tab][tab]let last space be the location of Athena;
[tab][tab]if Athena can be seen by the player, say "Athena heads to [the
destination entry].";
[tab][tab]move Athena to destination entry;
[tab][tab]if Athena can be seen by the player, say "Athena arrives from
[the last space].";
[tab][tab]blank out the whole row;
[tab][tab]rule succeeds.
I hope this solves this for you.
--Erik