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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:59:57+00:00 2026-06-14T00:59:57+00:00

Hopefully a simple question to most programmers with some experience. What is the datatype

  • 0

Hopefully a simple question to most programmers with some experience.

What is the datatype that lets me do this?

Dim lstOfStrings as *IDK*

Dim String0 As String = "some value"
Dim String1 As String = "some value"
Dim String2 As String = "some value"
Dim String3 As String = "some value"
Dim String4 As String = "some value"
Dim String5 As String = "some value"


lstOfStrings.add(String0, String1, String2, String3)

I would access these like this

Dim s1 = lstOfStrings(0)
Dim s2 = lstOfStrings(1) 
Dim s3 = lstOfStrings(2) 
Dim s4 = lstOfStrings(3)

if I use List(of String)
I am only able to .add one thing to the list (at a time), and in my function I want to be able to store several values(at a time).

Solution:

Private Function Foo() As List(Of String)


    Dim temp1 As String
    Dim temp2 As String 
    Dim temp3 As String 

    Dim temp4 As String 
    Dim temp5 As String 
    Dim temp6 As String 

    Dim inputs() As String = {temp1, temp2, temp3, temp4, temp5, temp6}

    Dim lstWriteBits As List(Of String) = New List(Of String)(inputs)


    Return lstWriteBits
End Function
  • 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-14T00:59:58+00:00Added an answer on June 14, 2026 at 12:59 am

    List(Of String) will handle that, mostly – though you need to either use AddRange to add a collection of items, or Add to add one at a time:

    lstOfString.Add(String1)
    lstOfString.Add(String2)
    lstOfString.Add(String3)
    lstOfString.Add(String4)
    

    If you’re adding known values, as you show, a good option is to use something like:

    Dim inputs() As String = { "some value", _
                                  "some value2", _
                                  "some value3", _
                                  "some value4" }
    
    Dim lstOfString as List(Of String) = new List(Of String)(inputs)
    
    ' ...
    Dim s3 = lstOfStrings(3)
    

    This will still allow you to add items later as desired, but also get your initial values in quickly.


    Edit:

    In your code, you need to fix the declaration. Change:

    Dim lstWriteBits() As List(Of String) 
    

    To:

    Dim lstWriteBits As List(Of String) 
    

    Currently, you’re declaring an Array of List(Of String) objects.

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

Sidebar

Related Questions

I imagine that this is a simple question, but I'm getting some strange results
This is hopefully a simple question: I have an OpenGL texture and would like
hopefully a pretty simple question this time. I have a Select method in a
Hopefully this is a quick question. I'm making a simple rock paper scissors game.
im struggling with syntax here: hopefully this question is v simple, im just miising
Hopefully simple question: I'm trying to set the alternatingItemColors on a datagrid via some
This is hopefully a very simple maths question. If I have two number ranges,
Hopefully this is a simple question to answer - I think I'm being a
I have a quick and hopefully simple question that I hope someone can help
I have a hopefully pretty simple question here. I'm converting some Access SQL script

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.