Subj : Re: Skipped Code To : borland.public.cpp.borlandcpp From : Georges Date : Fri Jul 18 2003 07:16 am Ed Mulroy [TeamB] wrote: >That would make sense if the variable hrpos was not used from then on in the >function. If so then testing if it was above 12 and decrementing it by 12 >could be elimiated by the optimizer. > >. Ed > > > >>Georges wrote in message >>news:3f155dca$1@newsgroups.borland.com... >>Has anyone else come across bits of code being skipped >>(Borland 5.02). EG: >> >> hrpos = 14; // for testing >> if (hrpos > 12) >> hrpos -= 12; >> abc = 5; >> >>When run, step by step in the debugger, with hrpos set >>to 14 (for testing) the two last statements are skipped. >>completely! The value of hrpos remains 14. The problem >>can sometimes be cured by moving the lines to >>somewhere else! >> >>Any ideas anyone ? >> >> > >Ed, > Ah! But it was used a few lines later, The program was not working because those lines were being skipped! I traced it right through, line by line. This is not the first time I've come across a similar thing after a simple 'if'. Georges .