Results 1 to 11 of 11

Thread: [RESOLVED] arrays

Hybrid View

  1. #1
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: arrays

    Quote Originally Posted by Aash View Post
    thanks chris
    what if i want to create an array at run-time?
    Quote Originally Posted by Aash View Post
    yes, i want to create an array at run-time like we use dynamic allocation of arrays in c++. In your code you are adding two strings at compile time, right?
    as i've said that i want to add items at run-time, is it possible in vb.net?


    Edit: how did ur post come at first? what's happening?
    This is at run time and no they are not concatinated together either, it's a collection of type String which means:
    Code:
    Dim AutomaticallyExpandingList As New List(Of String)
    
    AutomaticallyExpandingList.Add("hello") 'index 0
    AutomaticallyExpandingList.Add("world") 'index 1
    
    Messagebox.Show(AutomaticallyExpandingList(0)) 'Shows: hello
    Messagebox.Show(AutomaticallyExpandingList(1)) 'Shows: world
    
    Messagebox.Show(AutomaticallyExpandingList(0) & " " & AutomaticallyExpandingList(1)) 'Shows: hello world
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  2. #2
    Hyperactive Member Aash's Avatar
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    491

    Re: arrays

    Quote Originally Posted by JuggaloBrotha View Post
    This is at run time and no they are not concatinated together either, it's a collection of type String which means:
    Code:
    Dim AutomaticallyExpandingList As New List(Of String)
    
    AutomaticallyExpandingList.Add("hello") 'index 0
    AutomaticallyExpandingList.Add("world") 'index 1
    
    Messagebox.Show(AutomaticallyExpandingList(0)) 'Shows: hello
    Messagebox.Show(AutomaticallyExpandingList(1)) 'Shows: world
    
    Messagebox.Show(AutomaticallyExpandingList(0) & " " & AutomaticallyExpandingList(1)) 'Shows: hello world
    thanks for your code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width