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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:10:40+00:00 2026-05-25T13:10:40+00:00

In Delphi Prism, I need to assign objectcollection from ListBox to an ArrayList in

  • 0

In Delphi Prism, I need to assign objectcollection from ListBox to an ArrayList in a single statement. So far I have not found any solution.

In Delphi, this is how I did it.

theUser.Groups.Assign(ListBox1.Items);

Groups is a TList in Delphi and ArrayList in Delphi Prism. When I tried to do the same in delphi prism, it gives me the following errors.

“Groups.TGroupList” does not contain a definition for “Assign” in expression “theUser.groups.Assign”

If ArrayList doesn’t have method that accepts objectcollection, then I will have to loop through each objects in the ListBox items and add it to ArrayList.

How would you do it?

Thanks in advance.

  • 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-25T13:10:41+00:00Added an answer on May 25, 2026 at 1:10 pm

    You should use the AddRange() method of ArrayList.

    The equivalent to your Delphi code is:

    theUser.Groups.Clear();
    theUser.Groups.AddRange(ListBox1.Items);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written an ASP.NET web application (not site) in Delphi Prism. Everything works
I have installed Delphi Prism and XNA Game Studio 3.0. I have managed to
I have created below simple testcase in Delphi Prism . When I run the
I need something similar to TAnimate in Delphi win32 for Delphi Prism for .NET.
What is the equivalent of the c# lock() statement in Delphi Prism? In VB.Net
I'm asking for Delphi native, not Prism(net). This is my code: raise Exception.Create('some test');
Has anybody had any hands-on experience using Devexpress ASP.NET components with Delphi Prism? At
I am coding in Delphi Prism and I need to pause a loop with
I am learning to program in Delphi Prism and have gone through a crash
Either I am not totally understanding how events work or Delphi Prism has gone

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.