Results 1 to 11 of 11

Thread: [RESOLVED] arrays

  1. #1

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: arrays

    Huh? That is at runtime
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


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

    Resolved [RESOLVED] arrays

    Is it possible to create dynamic arrays, if so then how?






    ThankS In AdvancE!!!

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

    Re: arrays

    Well you can always ReDim arrays, but realistically this is why Collections are so powerful. What are you trying to do?
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

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

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

    Re: arrays

    Quote Originally Posted by JuggaloBrotha View Post
    Well you can always ReDim arrays, but realistically this is why Collections are so powerful. What are you trying to do?
    Just want to know like dynamic allocation is created in c++ , so if there's any way to create such in VB.Net too?

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

    Re: arrays

    I'm not familiar with c++ so I couldn't tell you if dynamic allocation in c++ is available in vb.net
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

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

  6. #6

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: arrays

    Just use a collection, same result

    vb Code:
    1. Dim AutomaticallyExpandingList As New List(Of String)
    2.  
    3. AutomaticallyExpandingList.Add("hello")
    4. AutomaticallyExpandingList.Add("world")
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


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

    Re: arrays

    Quote Originally Posted by chris128 View Post
    Just use a collection, same result

    vb Code:
    1. Dim AutomaticallyExpandingList As New List(Of String)
    2.  
    3. AutomaticallyExpandingList.Add("hello")
    4. AutomaticallyExpandingList.Add("world")
    thanks chris
    what if i want to create an array at run-time?

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

    Re: arrays

    Quote Originally Posted by chris128 View Post
    Huh? That is at runtime
    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?
    Last edited by Aash; Dec 17th, 2010 at 11:49 AM.

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

    Re: arrays

    i've cleared that now from Athiest
    thanks for your reply chris.

  10. #10
    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

  11. #11
    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