Is this a good way to do this or?

  • Thread starter Thread starter Kenneth
  • Start date Start date
K

Kenneth

Dim iNr(selectedItems.Count - 1) As System.Int32

Dim i As System.Int16 = -1

For Each Item In selectedItems

i += CShort(1)

iNr(i) = CInt(Item.Text)

Next



or is there a better one

I dont like the i counter at all



//Kenneth
 
* "Kenneth said:
Dim iNr(selectedItems.Count - 1) As System.Int32

Dim i As System.Int16 = -1

For Each Item In selectedItems

i += CShort(1)

iNr(i) = CInt(Item.Text)

Next

\\\
Dim aintNumbers(SelectedItems.Count - 1) As Integer
Dim Item As ...
Dim i As Integer = 0
For Each Item in SelectedItems
aintNumbers(i) = Integer.Parse(Item.Text)
i += 1
Next Item
///

What's 'SelectedItems'?
 
Try this

Dim iNr() as System.Int32
For Each Item in selectedItems
ReDim Preserve iNr(iNr.length)
iNr(iNr.length-1) = CInt(Item.Text)
Next
 
Back
Top