cancel
Showing results for 
Search instead for 
Did you mean: 

While debugging How can i skip few lines of code ?

Former Member
0 Kudos

Hi Guru.

While debugging i want to skip the execution of few lines of code , Can anyone help on this .

line no 2

line no 3  me->initialize_abc( ).

line no 4  me->set_abc( ).

line 5

So when i am in line no 2 i need to skip execution of line no 3 and 4 . So i can check the output with and w/o the execution of these lines ..

Thanks in advance

Rocky

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

We have multiple ways to skip the lines in debugging mode.

  1. Put a break point at line 5(from where you want to start debugging).

           a. Double click on the line from where you want to start debugging. Then system                automatically creates a break point there. Then Press F8 then cursor will stop at                break point(Line 5)

           b. Place the cursor at line 5 and create a break point from menu tool bar. Use the                below path.

Breakpoint-->line breakpoint-->set/delete

And press F8 then it will stop at line 5.

      2. Place the cursor at line 5 and press SHIFT+F12.  Then cursor will come to line 5           automatically.

3. We can create break point using the below path

     From MENU  Breakpoints-->Break point at-->

Like this we have so many ways to create a break point ( or skip line).

Use any one of the way and debug your program.

Thanks & Regards,
satya.

Former Member
0 Kudos

Hi,

Put a Breakpoint point at line 2. When your debugger comes to line 2. Press F5 so that line 2 gets executed. Now click on line 5. From Menu select Debugger->Goto Line. It will automatically skip lines 3 and 4.

former_member199125
Active Contributor
0 Kudos

Put two break points, in line2 and line 5.

when you execute F8, first it will stop at line 2. Again if you press F8 then it will stop at line 5. 

Regards

Srinivas    

former_member184578
Active Contributor
0 Kudos

Hi,

srinivas sana wrote:

when you execute F8, first it will stop at line 2. Again if you press F8 then it will stop at line 5. 

  

When we press F8 at line 2, line 3 and 4 will also be executed. We have to use Go to statement ( SHIFT + F12 ) by keeping cursor at line 5.

Regards,

Kiran.

former_member267127
Discoverer
0 Kudos

Take cursor on line, where you want to go and press "shift" + f12.

mzemmour
Explorer
0 Kudos

hi,

It's the right solution.

Tnx.

Former Member
0 Kudos

Hi,

You can do either the following depending on your requirement :

1. to execute lines 2 & 3 and jump to line no.5(from line 1) => position cursor on line 5, right click & select option "Create Break-point" from the context menu

2. to skip execution of lines 2 & 3 and jump to line no.5(from line 1) => position cursor on line 5, right click & select option "Go to statement" from the context menu

-Swami.

former_member186016
Active Contributor
0 Kudos

Hi,

I think the only way is to comment out those two lines.

Or

Change logic so that those two lines are executed if some var is true. At debugging change the value of var when you reach if statement so that you skip the if block,

Regards, Ashwani Kr Sharma