Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Inform 7 / Glulx problem with ReadChoice routine

9 views
Skip to first unread message

Victor Gijsbers

unread,
Apr 30, 2007, 9:47:12 AM4/30/07
to
Hello all,

I'm attempting to compile Fate to Glulx, because it has reached the z8
limits (at least the non-release version has). However, I get this error:

File "auto.inf"; Line 33343 # Error: *** Statement code gen: Can't
generate yet ***


I looked at the auto.inf source, and this is the routine that is causing
the problem:


[ ReadChoice low high i;
for (::) {
print ">> ";
read buffer parse;
i = TryNumber(1);
if (i >= low && i <= high) return i;
}
];

The offending line is "read buffer parse".


Any idea how I can solve this? What might be causing it?

Regards,
Victor

Andrew Plotkin

unread,
Apr 30, 2007, 12:14:32 PM4/30/07
to
Here, Victor Gijsbers <vic...@lilith.gotdns.org> wrote:
> Hello all,
>
> I'm attempting to compile Fate to Glulx, because it has reached the z8
> limits (at least the non-release version has). However, I get this error:
>
> File "auto.inf"; Line 33343 # Error: *** Statement code gen: Can't
> generate yet ***
>
> [...]

> The offending line is "read buffer parse".

Reading a line of text is too complicated to do as a single statement.
You probably want to call the KeyboardPrimitive() library routine.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*
If the Bush administration hasn't subjected you to searches without a
warrant, it's for one reason: they don't feel like it. Not because of
the Fourth Amendment.

Victor Gijsbers

unread,
Apr 30, 2007, 12:31:18 PM4/30/07
to
Andrew Plotkin wrote:

> Reading a line of text is too complicated to do as a single statement.
> You probably want to call the KeyboardPrimitive() library routine.

Thing is - all I have written myself is Inform 7 code. I have no idea
which of my Inform 7 code is translated into the offending Inform 6
code. Any ideas where I might look?

Regards,
Victor

Emily Short

unread,
Apr 30, 2007, 12:32:57 PM4/30/07
to

It's not being translated; this is a piece of Simple Chat.

Victor Gijsbers

unread,
Apr 30, 2007, 3:32:43 PM4/30/07
to
Emily Short wrote:

> It's not being translated; this is a piece of Simple Chat.

Hm! Interesting! So Simple Chat is not Glulx-compatible?

Ok, I'll try and figure out a way around this then.

Regards,
Victor

Victor Gijsbers

unread,
Apr 30, 2007, 3:45:58 PM4/30/07
to
Victor Gijsbers wrote:

> Hm! Interesting! So Simple Chat is not Glulx-compatible?
>
> Ok, I'll try and figure out a way around this then.

The way around is easy (a Google search on "read buffer parse" is your
friend.) Where there is now "read buffer parse", write:

#ifdef TARGET_ZCODE;
read buffer parse;
#ifnot; ! TARGET_GLULX;
KeyboardPrimitive(buffer, parse);
#endif; ! TARGET_


That appears to work, and Fate now compiles to Glulx. :)

Regards,
Victor

Andrew Plotkin

unread,
Apr 30, 2007, 3:53:58 PM4/30/07
to
Here, Victor Gijsbers <vic...@lilith.gotdns.org> wrote:
> Victor Gijsbers wrote:
>
> > Hm! Interesting! So Simple Chat is not Glulx-compatible?
> >
> > Ok, I'll try and figure out a way around this then.
>
> The way around is easy (a Google search on "read buffer parse" is your
> friend.) Where there is now "read buffer parse", write:
>
> #ifdef TARGET_ZCODE;
> read buffer parse;
> #ifnot; ! TARGET_GLULX;
> KeyboardPrimitive(buffer, parse);
> #endif; ! TARGET_

You can actually get rid of the ifdefs, and simply have

KeyboardPrimitive(buffer, parse);

as the entire line. The Z5/Z8 version of that routine *is* just a "read
buffer parse" statement.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

If the Bush administration hasn't thrown you in military prison without trial,
it's for one reason: they don't feel like it. Not because you're an American.

0 new messages