Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7055767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:47:17+00:00 2026-05-28T03:47:17+00:00

In my previous question I was suggested to use Interface: How to implement identical

  • 0

In my previous question I was suggested to use Interface:
How to implement identical methods with 2 and more Classes?

But nothing complies as I have no knowledge on how to use Interfaces.

I guess you can call this code pseudo 🙂

type
  IDoSomething = interface
    ['{EFE0308B-A85D-4DF3-889C-40FBC8FE84D0}']
    procedure DoSomething1;
    procedure WMSize(var Message: TWMSize); message WM_SIZE; // <- Unknown directive: 'message'
  end;

  TMyCheckBox = class(TCheckBox, IDoSomething) // <- Undeclared identifier: 'DoSomething1'
  end;

  TMyRadioButton = class(TRadioButton, IDoSomething) // <- Undeclared identifier: 'DoSomething1'
  end;

implementation

procedure IDoSomething.DoSomething1; // Identifier redeclared: 'IDoSomething'
begin
  // do the same thing for TMyCheckBox and TRadioButton
end;

procedure IDoSomething.WMSize(var Message: TWMSize);
begin
  // handle this message the same as with TMyCheckBox and TRadioButton
end;

How do I use the Interface to centralize the code?
and How can I share new properties with the help of the Interface?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:47:18+00:00Added an answer on May 28, 2026 at 3:47 am
    1. the message keyword is not allowed in an interface method declaration. Remove message WM_SIZE; and the code will run fine until the compiler hits the second problem – see below

    2. Interface methods never have their own implementations. If the IDoSomething interface declares a method DoSomething1, the compiler will not allow to write an implementation like procedure IDoSomething.DoSomething1; like in your code – instead, the class which implements the interface has to provide the implementation body.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In answer to a previous question , several people suggested that I use BeautifulSoup
In response to a previous question , @Pablo Fernandez suggested I implement a simple
In a previous question I asked, the suggested answer was for me to partition
This question is related to my previous question . The storyline: I have an
New question As suggested by Asaph in previous question: Regex to check if exact
As suggested in answers to a previous question , I tried using Erlang proplist
I know that this question might have been asked like 100 times, but, believe
In comments to my previous question it was suggested to extract all the data
My previous question broght up some discussion which suggested that I am wrong to
I have a WCF service, which works if I use one login, but throws

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.