Debugging For Values In Infinite Loops

edited July 2015 in How To...

Hello,

I am trying to debug an infinite recessive function. I have tried debugging the base case by printing the values, but obviously you can not keep up with the processor. I have also tried using the millisecond function to output a value every few seconds, but the process is too fast and outputs about 40.

The noloop function will not work unless the program returns to the draw function, which it will not because the recursive function is independent. I also do not want to implement a complicated user-based solution because it takes too much time.

Is there any way to pause or stop the program? I know that visual studios has breakpoints, and eclipse has a function that waits for a user input. Does processing have something similar?

I would be satisfied if I could just break the program and look at the beginning of the values without the console being overfilled and deleting some. Is there any god way to do this?

Thanks

Answers

  • edited July 2015 Answer ✓

    no break points in processing (maybe in IDE X?)

    you can

    • count the println and stop after 100 (with a global var)

    • write to a file instead

    • have a recursion that ends at depth 10

    Chrisir

  • Using a counting variable to stop the function worked well, thanks a lot.

Sign In or Register to comment.