Why if executes two times?

If I set a breakpoint at if statement, I see that the statement gets
executed two times.. why so?

···

--
Posted via http://www.ruby-forum.com/.

It shouldn't happened, may be due to IDE gives the illusion to you.

···

On Thu, Aug 9, 2012 at 4:03 PM, ajay paswan <lists@ruby-forum.com> wrote:

If I set a breakpoint at if statement, I see that the statement gets
executed two times.. why so?

--
Posted via http://www.ruby-forum.com/\.

ZhanGNer wrote in post #1071763:

It shouldn't happened, may be due to IDE gives the illusion to you.

So how can I find the reason for illusion? or what I need to do now?

···

--
Posted via http://www.ruby-forum.com/\.

There are three questions I would need you to answer to be able to help further:
* What is the if statement in question?
* Is it in a reentrant position (e.g. a loop)?
* What are you using to set a breakpoint / debug the program?

···

On 9 August 2012 19:32, ajay paswan <lists@ruby-forum.com> wrote:

ZhanGNer wrote in post #1071763:

It shouldn't happened, may be due to IDE gives the illusion to you.

So how can I find the reason for illusion? or what I need to do now?

--
  Matthew Kerwin, B.Sc (CompSci) (Hons)
  http://matthew.kerwin.net.au/
  ABN: 59-013-727-651

  "You'll never find a programming language that frees
  you from the burden of clarifying your ideas." - xkcd

awesome
may be you can paste your code if possible, and point out which line you
set a breakpoint.

···

On Thu, Aug 9, 2012 at 5:52 PM, Matthew Kerwin <matthew@kerwin.net.au>wrote:

On 9 August 2012 19:32, ajay paswan <lists@ruby-forum.com> wrote:
> ZhanGNer wrote in post #1071763:
>> It shouldn't happened, may be due to IDE gives the illusion to you.
>
> So how can I find the reason for illusion? or what I need to do now?

There are three questions I would need you to answer to be able to help
further:
* What is the if statement in question?
* Is it in a reentrant position (e.g. a loop)?
* What are you using to set a breakpoint / debug the program?

--
  Matthew Kerwin, B.Sc (CompSci) (Hons)
  http://matthew.kerwin.net.au/
  ABN: 59-013-727-651

  "You'll never find a programming language that frees
  you from the burden of clarifying your ideas." - xkcd

* What is the if statement in question?
* Is it in a reentrant position (e.g. a loop)?
* What are you using to set a breakpoint / debug the program?

Just where the breakpoint is marked, is the place I set the breakpoint,
and in the next statement also I set the break point, but it doesnt go
to next till it gets executed two times, and yes I am using a
debugger..with intelliJ idea and ruby.

···

--
Posted via http://www.ruby-forum.com/\.

ZhanGNer wrote in post #1071768:

awesome

Really!

see the program:

var=5
if var == 10 #breakpoint here
     puts("Variable is 10")
end

I am using a breakpoint here 'pointed' and when I press resume, it comes
again here, but when I program with java, this is not the case, it goes
to the next step. I use intelliJ IDEA.

···

--
Posted via http://www.ruby-forum.com/\.