Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2023-08

overriden or not ?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bart
to Adriaan van Os
Is there a way to see if a specific class/object method has been overridden or not ?

There's an example of this in Lazarus Controls unit:

  // Check if SetTextBuf is overridden, otherwise
  // we can call RealSetText directly
  if TMethod(@Self.SetTextBuf).Code = Pointer(@TControl.SetTextBuf)
then //not overridden
Bart

Reply by email

Adriaan van Os
to Bart
Bart wrote 11 lines
On Fri, Aug 18, 2023 at 10:21 AM Adriaan van Os via fpc-pascal wrote: > Is there a way to see if a specific class/object method has been overridden or not ? There's an example of this in Lazarus Controls unit: // Check if SetTextBuf is overridden, otherwise // we can call RealSetText directly if TMethod(@Self.SetTextBuf).Code = Pointer(@TControl.SetTextBuf) then //not overridden

Thanks,

Adriiaan van Os

Reply by email