Recent

Author Topic: F4 - Run to cursor  (Read 4535 times)

BLL

  • Full Member
  • ***
  • Posts: 232
F4 - Run to cursor
« on: June 25, 2016, 11:42:35 am »
Hi, Can anyone help?
I have come to lazarus from CBuilder. One of the debugging options I find very useful is the run to cursor, but it is always greyed out and therefore not available.
Why please?
Brian

rvk

  • Hero Member
  • *****
  • Posts: 3836
Re: F4 - Run to cursor
« Reply #1 on: June 25, 2016, 12:12:05 pm »
Yeah, that's also something I needed to get used to.
F4 only works within the procedure you are at that moment.
It doesn't work like in Delphi.

The workaround is... you go to the place where you want to go.
But you don't press F4 but F5 and press F9 (run).
F5 sets a breakpoint.
When the program breaks you directly press F5 again and the breakpoint is released.

It would be neat if Lazarus could implement that F5, F9 & F5 under the F4 button :)
(But for now you can do it that way)
« Last Edit: June 25, 2016, 12:13:51 pm by rvk »

BLL

  • Full Member
  • ***
  • Posts: 232
Re: F4 - Run to cursor
« Reply #2 on: June 25, 2016, 06:48:13 pm »
Hi, Thanks for the info. If it's that badly implemented, F4 shouldn't be there!

I also don't understand why compile, make and build are on the Run menu!

If you are going to run a programme, it must be built first! In CBuilder, these items were on the Project menu, which, I think, makes much more sense. You build a project and then you run it!

Brian

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5633
    • wiki
Re: F4 - Run to cursor
« Reply #3 on: June 25, 2016, 08:42:13 pm »
It is not badly implemented, it implements a different function. It is "step to cursor"

http://bugs.freepascal.org/view.php?id=21958#c59370

rvk

  • Hero Member
  • *****
  • Posts: 3836
Re: F4 - Run to cursor
« Reply #4 on: June 25, 2016, 08:53:28 pm »
It is not badly implemented, it implements a different function. It is "step to cursor"
Well, it doesn't say "Step to Cursor (F4)" but it says "Run to Cursor (F4)". And because the naming in Delphi is exactly the same it confuses the hell out of people just beginning with Lazarus :)

Luckily I learned quit quickly to use the F5 for breakpoint but seeing that different function uses the same name and even the same function key as Delphi, I can understand the confusion.

BLL

  • Full Member
  • ***
  • Posts: 232
Re: F4 - Run to cursor
« Reply #5 on: June 25, 2016, 09:34:15 pm »
I don't follow your logic! Run to cursor means run the program until it reaches the point where you have put the cursor. Of course you can set a breakpoint, but surely, the whole idea of F4 was to be quicker. Otherwise, you need 2 steps - 1 set breakpoint, 2 run program!
CBuilder had it right, lazarus, in my opinion does not!

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5633
    • wiki
Re: F4 - Run to cursor
« Reply #6 on: June 25, 2016, 10:30:52 pm »
Yes, it is currently wrongly named.

Lazarus does not have "run to cursor" at all. It has a different function.

"step to cursor" can be useful too. So the function itself is not wrong, or bad, it is just a different one.

Both needs to be done:
- fix the name
- implement "run to c"

duzenko

  • Newbie
  • Posts: 1
Re: F4 - Run to cursor
« Reply #7 on: August 30, 2019, 12:14:30 pm »
Nice to know that it's 2019 and still no Run to Cursor