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 8110919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:55:51+00:00 2026-06-06T01:55:51+00:00

Why does Memo.Lines use the abstract class TStrings ? Why doesn’t it use TStringList

  • 0

Why does Memo.Lines use the abstract class TStrings? Why doesn’t it use TStringList instead?

And should I convert it to TStringList before working with it?

  • 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-06-06T01:55:52+00:00Added an answer on June 6, 2026 at 1:55 am

    TMemo.Lines, TListBox.Items, TComboBox.Items, etc. ; all are declared as TStrings. Beware, talking about the property that is! The internal created types are TMemoStrings, TListBoxStrings and TComboBoxStrings respectively, which are all descendants of TStrings and differ all in way of storage.

    And why? For interchangeability and interoperability. So every TStrings-descendant has the same properties, and so you can do:

    Memo1.Lines := ListBox1.Items;
    

    How to use? Well, a TStrings property like TMemo.Lines works just fine. You can add, delete, change, renew and clear the strings (and objects) on the property, because internally it is a TMemoStrings which implements all this interaction. Declaration <> implementation.

    But when you want any special handling, e.g. like sorting which TStringList provides, then you need help. You cannot typecast nor convert a TMemo.Lines to a TStringList, because it isn’t one, but instead you need to create an intermediate object for this special processing:

    var
      Temp: TStringList;
    begin
      Temp := TStringList.Create;
      try
        Temp.Assign(Memo1.Lines);
        Temp.Sort;
        Memo1.Lines.Assign(Temp);
      finally
        Temp.Free;
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of any websites, or (preferably) downloadable packages that you can use
Does anyone here use phpmailer? I downloaded the files for phpmailer 5.2.1 (the newest
The MS access database does not allow comparing fields with 'memo' datatypes in SQL
I'm working on a C# project that uses System.Data.OleDb.OleDbCommand class to create and alter
Does the Date object in Javascript ever use a non-Gregorian calendar? The MDN and
Does anyone out there know if it is possible to use sharding with a
Does anyone have a working, step-by-step example of how to implement IEnumerable and IEnumerator
Does anyone know how to get IntelliSense to work reliably when working in C/C++
Does anyone know how to convert the string value type -4,5 or 5,4 into
Does there exist a utf8 code for x(4), functional for cross browser/os. According to

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.