Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!cc.tut.fi!cc.tut.fi!n67786 From: n67786@lehtori.tut.fi (Nieminen Tero) Newsgroups: comp.sys.mac.programmer Subject: Re: For Loops, Summary Message-ID: Date: 18 Jan 91 14:15:43 GMT References: <6968@crash.cts.com> <20058@unix.SRI.COM> Sender: n67786@cc.tut.fi (Nieminen Tero) Organization: Tampere Univ. of Technology, Finland. Lines: 19 In-Reply-To: mxmora@unix.SRI.COM's message of 16 Jan 91 20:04:21 GMT >In article <20058@unix.SRI.COM> mxmora@unix.SRI.COM (Matt Mora) writes: > >>In article <6968@crash.cts.com> kevin@crash.cts.com (Kevin Hill) writes: >> >> The problem seems to be that the variables j and k do wild things after >>they do what is expected of them. Then they go off to change the correct >>value of surround[9] to something wierd and go off into lala land. > >Have you bothered to single step through your code with a source level >debugger (or macsbug for that matter)? Maybe you can find out why j and k >"do wild things" or where they get tromped on. Loop variables are usually allocated in cpu registers and thus their value is not guarranteed outside the loop. The registers might or might not get trashed immediately after the last statement in the loop. Read the documentation of your compiler. -- Tero Nieminen Tampere University of Technology n67786@cc.tut.fi Tampere, Finland, Europe