Delphi_developer
asked on
How to debug For loops?
I use a lot of For loops and when I need to debug what is going on - step-by-step execution within the for loop, I use break-point like this:
For i:=a to b do
begin
...
if i=541 then
sleep(0); <- this is the line with (F5) break-point to so I can analyze execution when i = 541
...
end;
Is there any other way, it is annoying when I need to add the code and breakpoint and recompile and run again.
I see there are options on Breakpoint Properties with Condition, Thread, Pass count, Group values.
I tried to set Pass count to 541 or Condition to i=541, but nothing worked on simple break-point on any line, without sleep(0);
Is there any easy way to do this?
For i:=a to b do
begin
...
if i=541 then
sleep(0); <- this is the line with (F5) break-point to so I can analyze execution when i = 541
...
end;
Is there any other way, it is annoying when I need to add the code and breakpoint and recompile and run again.
I see there are options on Breakpoint Properties with Condition, Thread, Pass count, Group values.
I tried to set Pass count to 541 or Condition to i=541, but nothing worked on simple break-point on any line, without sleep(0);
Is there any easy way to do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you also for quick logging example.