|
-
Dec 17th, 2010, 10:24 AM
#1
-
Dec 17th, 2010, 10:26 AM
#2
Hyperactive Member
[RESOLVED] arrays
Is it possible to create dynamic arrays, if so then how?
ThankS In AdvancE!!!
-
Dec 17th, 2010, 10:30 AM
#3
Re: arrays
Well you can always ReDim arrays, but realistically this is why Collections are so powerful. What are you trying to do?
-
Dec 17th, 2010, 10:33 AM
#4
Hyperactive Member
Re: arrays
 Originally Posted by JuggaloBrotha
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?
-
Dec 17th, 2010, 10:36 AM
#5
Re: arrays
I'm not familiar with c++ so I couldn't tell you if dynamic allocation in c++ is available in vb.net
-
Dec 17th, 2010, 10:47 AM
#6
Re: arrays
Just use a collection, same result
vb Code:
Dim AutomaticallyExpandingList As New List(Of String)
AutomaticallyExpandingList.Add("hello")
AutomaticallyExpandingList.Add("world")
-
Dec 17th, 2010, 10:53 AM
#7
Hyperactive Member
Re: arrays
 Originally Posted by chris128
Just use a collection, same result
vb Code:
Dim AutomaticallyExpandingList As New List(Of String)
AutomaticallyExpandingList.Add("hello")
AutomaticallyExpandingList.Add("world")
thanks chris 
what if i want to create an array at run-time?
-
Dec 17th, 2010, 11:23 AM
#8
Hyperactive Member
Re: arrays
 Originally Posted by chris128
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.
-
Dec 17th, 2010, 11:49 AM
#9
Hyperactive Member
Re: arrays
i've cleared that now from Athiest
thanks for your reply chris.
-
Dec 17th, 2010, 11:50 AM
#10
Re: arrays
 Originally Posted by Aash
thanks chris 
what if i want to create an array at run-time?
 Originally Posted by Aash
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
-
Dec 17th, 2010, 11:52 AM
#11
Hyperactive Member
Re: arrays
 Originally Posted by JuggaloBrotha
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|