Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

VB.Net's equivalent of lists in C++?

I want to collect some information in an "array", the only problem is: I don't how large the array could be. I won't be that surprised if it had to encompass 100,000 values or so. So, I'm wondering how to create a list in VB.Net, something similar to arrays basically but which take heaps whenever needed and return them after being destructted, thus allowing me to insert as much information as I need.

Update:

Although both were false, the website LoW provided helped me find out what the actual declaration looked like. In case anybody browsing this question wants to know, here's how it looks like:

Dim nameOfList As List(Of type)

e.g.

Dim names As List(Of String)

Remember not to put an s after the type name.

e.g.

Dim names as List(Of Strings)

'This is wrong.

No kidding, almost fell into that trap myself.

3 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    Do you want this in C++ or Visual Basic? Sorry I just couldn't understand your question quite well.

    This is how to do it in Visual Basic:

    Dim x() as String 'Dynamic array, which you can set the limit to later on.

    You can set the highest value like this:

    ReDim x(6) as String

    If you want to keep the values just go like this:

    ReDim Preserve x(6) as String

  • cyree
    Lv 4
    5 years ago

    i could upload Nigel Calder to Trevor's checklist. simply by fact the former editor of recent Scientist and a nicely-liked technology e book author, he pushed the thought Earth grew to become into heading right into a sparkling ice age. Now in case you notice him interior the great worldwide Warming Swindle he is going on and on approximately how "scientists" have been incorrect to push cooling lower back interior the 70's, whilst he grew to become into extra to blame than any scientists for spreading the belief.

  • Anonymous
    1 decade ago

    It is very similar to C#.NET

    list <type> name;

    http://www.vbdotnetheaven.com/UploadFile/camurphy/...

Still have questions? Get your answers by asking now.