Results 1 to 4 of 4

Thread: [RESOLVED] Stuck in a loop.

  1. #1

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,378

    Resolved [RESOLVED] Stuck in a loop.

    Hi,

    How do I go about finding where a project is (presumably) 'stuck in a loop' ?

    I'm trying to modify a fully working project so there can only be the few places where the problem can be, however the project works with hundreds of lines of text and trying to wade through them has taken a few hours now and I've still not found where the fault is.
    Running the code without a break point, it just goes so far and them 'hangs' quite early on, but I don't know if there is a way to find which part of the code it's 'at'.


    Poppa
    Along with the sunshine there has to be a little rain sometime.

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    109,078

    Re: Stuck in a loop.

    There's a Break button in VS that allows you to break any time in the same way a break point would so just wait for the hang and click that button.

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    37,718

    Re: Stuck in a loop.

    There are two possible causes for that hang, too, and the break button will find both. You could have a perpetual loop, or you could have a deadlock. When you hit break, you'll be taken to some line. If F11 then steps forwards, you are in a perpetual loop. If F11 does not step forwards, you are deadlocked.

    Perpetual loops can be fascinating, because they can be very complicated. Deadlocks tend to be even more fascinating, though just because you'll end up learning something you didn't know before you solve it. In both cases, though, the most typical scenario is not fascinating at all, it's boring. As soon as you see where, you'll know why. Nothing terribly interesting in those cases.
    My usual boring signature: Nothing

  4. #4

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,378

    Re: Stuck in a loop.

    Thanks guys,

    That works !


    Poppa
    Along with the sunshine there has to be a little rain sometime.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width