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

  • Home
  • SEARCH
  • 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 9023571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:47:33+00:00 2026-06-16T05:47:33+00:00

Recently I’ve started working on project VB for my As computing class, and after

  • 0

Recently I’ve started working on project VB for my As computing class, and after few painful hours of vb coding i hit the solid brick wall. Which looks like this

Private Function store(ByVal opt As Integer, ByVal inp As String, ByVal q As String) As String
        Dim na_me(20), amount(20), num1 As String
        Select Case opt
            Case 0
                na_me(num1) += inp
                amount(num1) += q
                num1 += 1
                Return "1"
            Case 1
                For Each Str As String In na_me
                    Console.WriteLine(Str)
                Next
                Return "1"
            Case 2
                num1 = 0
                Return "1"
            Case Else
                Return "0"
        End Select
    End Function

Every time argument 1 is called it just returns blank screen instead of array full of data.
This function was designed to hold and save any data passed through function call, and then save it into array. and once 1 was passed as opt argument then print out all data held in arrays. I know this is a noob question but i’ve never used vb.net before and i’m only doing it at school.

Here’s rest of the code http://pastebin.com/nWxvx9pz

  • 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-16T05:47:35+00:00Added an answer on June 16, 2026 at 5:47 am

    Alternatively you could do something like this and use strongly typed collections/properties.

    If you did need to get these as an array all you would need to is MyStoredValues.ToArray()

    Module Module1
    
    
        Private na_me As List(Of String)
        Public Property MyStoredValues() As List(Of String)
            Get
                If na_me Is Nothing Then
                    na_me = New List(Of String)
                End If
                Return na_me
            End Get
            Set(ByVal value As List(Of String))
                na_me = value
            End Set
        End Property
    
    
        Private amount As List(Of String)
        Public Property MyAmount() As List(Of String)
            Get
                If amount Is Nothing Then
                    amount = New List(Of String)
                End If
                Return amount
            End Get
            Set(ByVal value As List(Of String))
                amount = value
            End Set
        End Property
    
    
    
        Sub Main()
            store(0, "TEST TEST TEST", "10.23")
            store(0, "TEST2 TEST2 TEST2", "11.33")
            store(1, "", "")
            Console.ReadKey()
        End Sub
        Private Function store(ByVal opt As Integer, ByVal inp As String, ByVal q As String) As Boolean
    
            Select Case opt
                Case 0
                    MyStoredValues.Add(inp)
                    MyAmount.Add(q)
    
                    Return True
                Case 1
                    For Each Str As String In MyStoredValues
                        Console.WriteLine(Str)
                    Next
                    Return True
    
                Case Else
                    Return False
            End Select
        End Function
    End Module
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently we started working with Database project in Visual Studio 2010. I have added
recently, while working on a db2 -> oracle migration project, we came across this
Recently I have been working with the xml coding,and the problem happened. Given the
Recently, I'm working on a Python-based project and facing a issue with dictionaries. In
Recently I started working with RAD and WebSphere on development of web services and
Recently I noticed (after others have extended the project) that the compile time significantly
Recently, I was writing a class in which I discovered that I could reduce
Recently the PHP manual started showing the following warning on every mysql function page:
recently I created a java class Custom Layout Manager , which I want to
Recently we started seeing a problem where the Application_Error event handler (for HttpApplication.Error )

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.