Re: Unlimited Array in Visual Basic 8
- From: "Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx>
- Date: Mon, 26 Feb 2007 20:10:09 +0100
Michel,
I am 100% sure that Herfried this knows.
Cor
"Michel Posseth [MCP]" <msnews@xxxxxxxxxxx> schreef in bericht
news:up0t2EdWHHA.896@xxxxxxxxxxxxxxxxxxxxxxx
or take a look at the array class
Dim x(1) As Integer ' create instance with one element
For i As Integer = 1 To 10
Array.Resize(x, x.Length + i) ' add some elements during runtime
Next
' to proof that it works
For Each i As Integer In x
Debug.WriteLine(i.ToString) ' writes out all zero`s for every element
Next
ofcourse you could do the above example with anny type you want
regards
Michel Posseth
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@xxxxxx> schreef in bericht
news:%23rvLecTWHHA.496@xxxxxxxxxxxxxxxxxxxxxxx
"Joe" <joe1977@xxxxxxx> schrieb:
hi. simple question: how can one declare Array (or table) with unknown
number of elements, and then assign values to it, example:
Dim TableStrings() as String
TableStrings(0) = "first value"
TableStrings(1) = "second"
TableStrings(2) = "tird" .... etc
You may want to use 'System.Collections.Generic.List(Of T)'.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
.
- References:
- Unlimited Array in Visual Basic 8
- From: Joe
- Re: Unlimited Array in Visual Basic 8
- From: Herfried K. Wagner [MVP]
- Re: Unlimited Array in Visual Basic 8
- From: Michel Posseth [MCP]
- Unlimited Array in Visual Basic 8
- Prev by Date: NullReferenceException when binding DataGridView to datasource
- Next by Date: Re: DirectoryInfo Getfiles - only for one file
- Previous by thread: Re: Unlimited Array in Visual Basic 8
- Next by thread: Re: Unlimited Array in Visual Basic 8
- Index(es):
Relevant Pages
|