Message-ID: <39CED3C1.6CEE0095@attglobal.net>
Date: Sun, 24 Sep 2000 21:25:37 -0700
From: Chip Hayes <jwhayes@attglobal.net>
X-Mailer: Mozilla 4.72 (Macintosh; U; PPC)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: rec.arts.int-fiction
Subject: Re: [Inform] ValueOrRun Question
References: <39C3A6C3.8F3B865A@attglobal.net> <39ce96b8.47488312@news.bright.net>
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 32.101.147.98
X-Trace: 25 Sep 2000 04:33:26 GMT, 32.101.147.98
Organization: Global Network Services - Remote Access Mail & News Services
Lines: 46
X-Complaints-To: abuse@prserv.net
X-Authenticated-User: name|pass
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!europa.netcrusader.net!4.1.16.34!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed.us.ibm.net!ibm.net!news1.prserv.net!32.101.147.98
Xref: news.duke.edu rec.arts.int-fiction:79193



Jonadab the Unsightly One wrote:

> > Even if the property in question is an integer  >255, the routine will
> > still properly return the value.
>

>Let me ask something:  are you *sure* this works for integers
>greater than 256?  I am highly skeptical about that.


Yes, it does.  As BrenBarn pointed out, if the property is an integer > 255,
ValueOrRun() will still return the correct answer, as RunRoutines() simply
comes back with the number itself.

The problem I had encountered was when ValueOrRun() was used to test a
door_to property to see what room object was on the other side (see the old
thief.inf source code).  This was a large game I was working with and
because of that (I'm assuming... I haven't delved THAT deep into the
z-machine) when ValueOrRun() returned the address of the door_to routine,
the game was large enough that the routine's address was coming out as a
negative number (-31948 or around.)   Thus, ValueOrRun() treated the routine
as a value instead of a routine( less than 255), and the proper routine was
never run.

Fact is, ValueOrRun() shouldn't have been used to get an object number in
the first place.

> This could be important, too.  Doesn't the library rely
> on ValueOrRun in certain cases -- such as when you put
> a routine in for a direction property?  Or am I in
> obsolete-Inform-5-thinking-mode in that respect, too?

ValueOrRun() is only used in the 6/10 library on three occasions: In
AttemptToTakeObject(), PutOnSub() and InsertSub(),  Each time it is only
used to test the capacity property.  So other than being an oddity - and one
that the glib caretaker (Zarf, I assume) has seemingly already caught -
there isn't much danger I can see... except for those that still use
ValueOrRun() in their programming.

But now you've got me curious as to why it was changed to this version in
the later libraries...

Chip Hayes

