Recent

Author Topic: TCustomApplication.DoRun  (Read 1123 times)

mcculloch

  • New Member
  • *
  • Posts: 23
TCustomApplication.DoRun
« on: July 11, 2025, 06:05:37 pm »
I am looking at Lazarus again since I was a big fan of Delphi many years ago.  I opened a new Console Application project and compiled it without adding anything.  It works, but of course doesn't do anything.  The class inheriting TCustomApplication declares a procedure DoRun as an override, suggesting that TCustomApplication has or inherits a DoRun procedure.  Is DoRun defined in one of the ancestors?

In general, I'm having difficulty figuring out how DoRun gets called.

Thanks

cdbc

  • Hero Member
  • *****
  • Posts: 2667
    • http://www.cdbc.dk
Re: TCustomApplication.DoRun
« Reply #1 on: July 11, 2025, 06:58:28 pm »
Hi
'TCustomApplication' has a method 'Run', that calls the /virtual/ 'DoRun' method, i.e.: It ends up calling your overridden 'DoRun' instead of the one in the ancester-class.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

mcculloch

  • New Member
  • *
  • Posts: 23
Re: TCustomApplication.DoRun
« Reply #2 on: July 11, 2025, 09:17:47 pm »
Thanks!  That makes sense.  I looked at the docs for TCustomApplication on freepascal.org and it doesn't list a procedure DoRun at all.  That's why I was confused.  It could be that it's not listed because it doesn't have an implementation for it.

dsiders

  • Hero Member
  • *****
  • Posts: 1551
Re: TCustomApplication.DoRun
« Reply #3 on: July 11, 2025, 09:28:08 pm »
Thanks!  That makes sense.  I looked at the docs for TCustomApplication on freepascal.org and it doesn't list a procedure DoRun at all.  That's why I was confused.  It could be that it's not listed because it doesn't have an implementation for it.

RTL and FCL docs do not include private or protected members.

cdbc

  • Hero Member
  • *****
  • Posts: 2667
    • http://www.cdbc.dk
Re: TCustomApplication.DoRun
« Reply #4 on: July 11, 2025, 09:31:55 pm »
Hi
You can always Ctrl + left-click on a method or a class and codetools will take you to the implementation, in the code editor ofc.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

 

TinyPortal © 2005-2018