Path: chuka.playstation.co.uk!news From: "Mark Wilson" Newsgroups: scee.yaroze.programming.codewarrior Subject: Debugger problem Date: Sun, 7 Jun 1998 19:35:10 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 37 Message-ID: <6lemid$1293@chuka.playstation.co.uk> NNTP-Posting-Host: userl403.uk.uudial.com X-Newsreader: Microsoft Outlook Express 4.72.3007.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3007.0 Another bug-ette has just reared its head, unless I've done something really stupid... which has been known. A routine I was working on was playing up, so I stuck in a breakpoint. There my troubles began. void GetCurrentPosition(Obj *obj) { short i, d, deltax, deltay; int dinc1, dinc2, xinc1, xinc2, yinc1, yinc2; deltax = obj->tx - obj->sx; deltay = obj->ty - obj->sy; Setting a breakpoint on the "deltay = " line I noticed that deltax was coming out as 0, not -640. Stepping through the next line, I found that deltay was being calculated OK. So I stuck in a printf before the calculation like printf("%d\t%d%t%d\n", obj->tx, obj->sx, obj-tx - obj->sx); which returned exactly the figures I'd expected, 0, 640 and -640. A printf AFTER the calculation showed that deltax was in fact being set up correctly, and was just not being displayed in the debugger. Any ideas? Mark