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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:06:52+00:00 2026-05-19T16:06:52+00:00

I have been tempted to use List(Of T) in VB.NET instead of ArrayLists by

  • 0

I have been tempted to use List(Of T) in VB.NET instead of ArrayLists by someone-who-must-not-be-named-Robinson.

Essentially, what I need to store are three things: One string, two integers, and maybe two booleans. I liked using ArrayList, because it treated all its elements as “Objects” so I didn’t really have problems storing that variety of elements.

But now I have been thinking of using List(Of T). But how do I do to store that variety of elements of mine? I have been thinking on making a Structure holding the five elements.

Sounds like a good idea? I heard somewhere that Structures are expected to have a short life. But I fear I will be having my structures for… forever, as long as my application lives. Does that make any difference?

Finally, what if I needed to create… don’t know…… 125,000,000 Lists, each containing a structure? Is that possible (and good)?

  • 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-19T16:06:52+00:00Added an answer on May 19, 2026 at 4:06 pm

    If you’re using a collection type (ArrayList or List(Of T)) just because you’re looking for a place to store a fixed number of completely different types, stop! You’re on the right track with creating a structure, though what you’re looking for is called a class.

    Since, from your other questions, it sounds like you’re creating a map editor, I’m assuming that your two numbers are X and Y coordinates, and I’d guess the string is a name of some kind? If so, very simple:

    Public Class Tile 
        Public Property Name as String
        Public Property X as Integer
        Public Property Y as Integer
    End Class
    

    (Note that the above will only work if you’re using Visual Studio 2010 and .NET 4; if not, respond and I’ll edit with a pre-4 compatible version)

    It will be much easier for you to refer to the .X and .Y properties rather than just throwing indexes around all over the place. This will also be much much faster (and take up less memory) than doing that.

    I’m going to forego a complete description of everything that’s there, as descriptions of what a class is and what properties are is pretty readily available. Does that help?

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

Sidebar

Related Questions

I've been using StackOverflow since the beginning, and have on occasion been tempted to
Have been having an issue sine using the HABTM relationship in models instead of
Have been learning ASP.NET (using C#) over the past few days. I have made
I have a server hosting a remoting application using .NET 3.5. It has been
Have been playing around with instruments with not much luck in figuring out how
Have been trying to encrypt an xml file to a string so that I
Have been working on this question for a couple hours and have come close
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
Have been reading about async and tasks and been attempting to convert the CopyFileEx
Have been searching how to convert a dictionary to a string. But the results

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.