Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!uni-regensburg.de!lrz-muenchen.de!informatik.tu-muenchen.de!Germany.EU.net!howland.reston.ans.net!vixen.cso.uiuc.edu!uchinews!kjfair
From: kjfair@midway.uchicago.edu (Kenneth Fair)
Subject: Re: help with inform and animate
X-Nntp-Posting-Host: ngrh-34.rh.uchicago.edu
X-Kook-Number-2: 14
Message-ID: <kjfair-1104961511240001@uchinews.uchicago.edu>
X-Kook-Code-2: (Grubor+++)*2 Boursy+ Palmer+++++++
Sender: news@midway.uchicago.edu (News Administrator)
Organization: University of Chicago School of Law
X-Newsreader: Yet Another NewsWatcher 2.2.0b6
References: <3160ABFE.A79@nando.net> <19960409.103010.12@spuddy.mew.co.uk> <QlP9muC00WB48RBS0r@andrew.cmu.edu>
Date: Thu, 11 Apr 1996 20:11:24 GMT
Lines: 46

In article <QlP9muC00WB48RBS0r@andrew.cmu.edu>, "Andrew C. Plotkin"
<erkyrath+@CMU.EDU> wrote:

>jaieff@spuddy.mew.co.uk (JJF) writes:
>> In article <3160ABFE.A79@nando.net>,
>>           thegoat@nando.net (Laralyn McWilliams) waffled about:
>> 
>> > When I copy the mummy's code from the Inform Manual to my game and try to
>> > compile, I get an error message. It says there is no such label as
>> > switch, and all of the nouns you can type in give errors like "no such
>> > constant," then "no such variable." It does the same thing when I type
>> > the text in, so I know it's not any hidden codes in the manual's format.
>> 
>> Hmmm - I seem to remember a thread a few months back that said that there
>> were some Inform compiler executables didn't have the code to handle the
>> "switch" construct, or something.  Does anyone know for sure?
>
>No, it wasn't that the code was *missing* (that would be hard to
>arrange :-) I think Inform was screwing up if you had a tab character
>(ctrl-I) between the ")" and the "{" in the line
>   switch (whatever) { ...
>Or maybe it was choking if you you put a newline before the "{". I
>don't remember. I always format switch statements the way I wrote that
>one, with spaces, not tabs, and I never had any trouble.


Yes.  This is exactly the problem.  I was having difficulty with switch
as well.  For example,

switch(random(3)) {
   1: "This is option number 1.";
   2: "Okay, option 2.";
   3: "You guessed it, option 3.";
}

If I used tabs before 1, 2, and 3, the compiler would return "No such 
routine as 1Sub" and so on.  Sometimes I would even replace the tabs with
spaces and I'd still get the same message.  Finally, I just block-copied
the text from the Designer's Manual, pasted it in, and changed the options.
That worked.  But it's an irritating workaround.

--
KEN FAIR - U. Chicago Law  | Power Mac! | Net since '90 | Net.cop
kjfair@midway.uchicago.edu | CABAL(tm) Member | I'm w/in McQ - R U?
   "Next to being witty yourself, the best thing is to quote
    another's wit" - C.N.Bovee
