delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/07/26/06:45:09

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Paul Wilkins <disk AT paradise DOT net DOT nz>
User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: strange error
References: <AL1Nc.380$zS6 DOT 55822 AT news02 DOT tsnz DOT net> <20040726055220 DOT 22465 DOT 00000447 AT mb-m11 DOT aol DOT com>
In-Reply-To: <20040726055220.22465.00000447@mb-m11.aol.com>
Lines: 36
Message-ID: <Ca5Nc.440$zS6.63234@news02.tsnz.net>
Date: Mon, 26 Jul 2004 22:38:15 +1200
NNTP-Posting-Host: 218.101.50.29
X-Complaints-To: abuse AT tsnz DOT net
X-Trace: news02.tsnz.net 1090838306 218.101.50.29 (Mon, 26 Jul 2004 22:38:26 NZST)
NNTP-Posting-Date: Mon, 26 Jul 2004 22:38:26 NZST
Organization: TelstraClear
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Sterten wrote:
>>If I'm to understand your thinking, you have in memory the Sym[][] array 
>>and just after that the R[] array, and you 
> 
> 
> I don't (yet) know where and how they are stored exactly
> 
> want to use R[r] to count 
>>from the R[] array down to a location in the Sym[][] array?
> 
> no ! This happened accidently due to a bug.

Let's head back to the line where the trouble occurs, which I presume 
you want to fix.

m55:r--;if(R[r]!=1)goto m55;

r gets decreased until R[r] = 1.

That needs to be fixed so that r doesn't go below 0, so we'll use a 
structure construct to help us understand more easily what's going on.

Is that right?

In that case, let's count down to 0 and break out when we're successful.

for (r; r>=0; r--) if (R[r]==0) break;

or

for (r; r>=0; r--)
   if (R[r]==1)
     break; // out of for loop

-- 
Paul Wilkins

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019