Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!news.rwth-aachen.de!news.ruhr-uni-bochum.de!news.uni-stuttgart.de!news.belwue.de!fu-berlin.de!news.nacamar.de!howland.erols.net!netcom.com!erkyrath
From: erkyrath@netcom.com (Andrew Plotkin)
Subject: Re: [Inform] strange bug. help??
Message-ID: <erkyrathE1Eqq3.Lpo@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: TIN [version 1.2 PL1]
References: <19961125004400.TAA01935@ladder01.news.aol.com>
Date: Mon, 25 Nov 1996 03:51:39 GMT
Lines: 37
Sender: erkyrath@netcom22.netcom.com

nnelson334@aol.com wrote:
> hello. this section of code, calls the script function in all interpretors
> ive tried this on.

> !      for(i=0:i<10:i++)
> !      {   roll_bank.number-->i = random((80)+20);
> !          print roll_bank.number-->i, "   ";
> !      }

> is this normal? this section is found in a regular verbSub function.
> anyone have any ideas?

What is this code supposed to do?

As far as I can tell, it writes random numbers into ten memory locations 
starting at roll_bank.number. This looks like a mistake. Consider what 
happens if roll_bank.number equals zero: 

for(i=0:i<10:i++)
{   0-->i = random...

You get the idea. This stomps all over the header with random numbers. 
It presumably triggers the script function as part of the mess it's making.

If the roll_bank.number is twenty bytes long, you probably mean

(roll_bank.&number)-->i = random(80) + 20;

This computes the starting address of the roll_bank.number property 
array, and writes ten numbers starting at that address.

--Z

-- 

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