4

Is there a shortcut (button/menu/etc) in the Delphi IDE that simply executes the last compiled EXE (with any specified parameters), without recompiling it?

Of course one can always create an external shortcut, but it'd be nice if there was a convenient way to do this from the IDE, without having to wait for an unnecessary recompile/linking if nothing was changed.

Magnus
  • 17,157
  • 19
  • 104
  • 189
  • I also wish that would be possible. Quite often I'd like to do that. For instance, I might have have changed some code partially so the code no longer compiles, but I still want to run the previously compiled version. Or I might want to start several instances. I have solved the issue by putting a shortcut on the desktop on my third monitor... I wonder if https://www.idefixpack.de/blog/ide-tools/ide-fix-pack/ can help. (Don't know.) – Andreas Rejbrand Nov 18 '19 at 13:39
  • If there have been no changes, nothing will be recompiled. F9 (run) or CTRL+F9 (run without debugging) will just launch the application right away. – J... Nov 18 '19 at 13:57
  • 3
    @J...: You mean Shift+Ctrl+F9? Well, my IDE still wants to compile again. – Andreas Rejbrand Nov 18 '19 at 14:09
  • @AndreasRejbrand Yes, with shift. It checks if it needs to recompile any units, but if the source has no changes it won't. Select build instead and get out a stopwatch. – J... Nov 18 '19 at 14:12
  • @J...: Well, if I create a new VCL app and run it with Shift+Ctrl+F9, I cannot start a new instance with Shift+Ctrl+F9 while the old one is running. – Andreas Rejbrand Nov 18 '19 at 14:14
  • @AndreasRejbrand That's not the question, though... OP seems only interested in avoiding the wait time for compilation. – J... Nov 18 '19 at 14:15
  • That said, even though F9 (or CTRL+SHIFT+F9) does not recompile any .dcus with unchanged source, it does recompile the main unit only and does re-link the application. This may be confused for a complete recompile, but it is much, much faster. There is no way to simply launch the existing application from within the IDE, however. It would be trivial to write an IDE extension (IOTAMenuWizard) to do this, I think, though. – J... Nov 18 '19 at 16:00
  • 1
    Insert a tool ("configure tools...") as such: program=`cmd` parameters=`/c start "run" /D $PATH($EXENAME) $EXENAME` . Parameters optionally followed by actual parameters you want to pass. Or build your own launcher.. – Sertac Akyuz Nov 18 '19 at 16:06
  • It would be nice if the IDE would not be enclosing the expanded macros with quotation marks, then it would be possible to launch the executable without requiring any intermediate launcher. It is also totally unnecessary since one can manually enclose macros with quotation marks when it is necessary. – Sertac Akyuz Nov 18 '19 at 16:09
  • 1
    In my experience the IDE rebuilds/compiles/links (whatever..) more often than not. Even when nothing have been changed.. – Sertac Akyuz Nov 18 '19 at 16:09
  • Correction: `/c start " " /D $PATH($EXENAME) $EXENAME $PARAMS` . Then you won't need anything else to pass parameters. – Sertac Akyuz Nov 18 '19 at 16:20
  • @SertacAkyuz The 'whatever' part is important. On a 'Run' or 'Compile' it will only recompile anything with source changes (or which makes reference to units with source changes), then link. On a Build it will perform a full recompile. If a small change in one unit forces a significant recompile then it's probably because that unit is a dependency for many other units which subsequently also must be recompiled. There's no getting around that if there are source changes, however. – J... Nov 18 '19 at 16:32
  • @J.. - It's not only source change. Test blank project: compile, run. Then ctrl+click on one of the used units: controls, forms etc. It will compile again. Presumably because of the blue dots. But my point is it's not only caused by source change. – Sertac Akyuz Nov 18 '19 at 16:51
  • @SertacAkyuz Can't repro (Seattle). The 'compile' dialog shows, but nothing other than the main unit is actually recompiled (as expected). – J... Nov 18 '19 at 16:55
  • @J.. - Why is it expected when the main unit hasn't been changed? – Sertac Akyuz Nov 18 '19 at 17:00
  • @SertacAkyuz "Expected" in the sense that it is consistent with the way we expect the IDE to behave, and consistent with the behaviour I've described above. The main unit does not produce a .dcu when compiled so we don't expect that it can recycle a precompiled .dcu for that unit. That's not to say this behavour is *required* on first principles, it's just how Delphi has always done it... so we expect it. – J... Nov 18 '19 at 17:09

1 Answers1

3

Is there a shortcut (button/menu/etc) in the Delphi IDE that simply executes the last compiled EXE (with any specified parameters), without recompiling it?

No there is not. You could easily extend the Tools menu to add such functionality. Or write an add-in to do the same. But there is nothing to do this out of the box.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490