Mijn probleem is dat ik bij een Array en een String (strSplit en DataArray(x, y) de volgende melding krijg " Value of type '1-dimensional array of string cannot be converted to string". Alleen ik zou niet weten hoe ik dit moet fixen en dat hij alsnog de Array en de strSplit de ; telt. Wie ziet dit wel.
Bvd.
Bart
Bvd.
Bart
PHP:
Imports System.IO
Public Class AllensWoodShop
Dim cntLines As Integer
Dim cntSplit As Integer
Public Function getLines()
Dim fileName As String = "woodsheets.txt"
Dim MyStream As New StreamReader(fileName)
Dim strSplit As String
Try
strSplit = MyStream.ReadLine.Split(";")
For Each c As Char In strSplit
If c = ";" Then
cntSplit += 1
End If
Next
While Not (MyStream.ReadLine() Is Nothing)
cntLines += 1
End While
Catch ex As Exception
End Try
Return cntLines & cntSplit
End Function
Private Function getArray()
getLines()
Dim lineNr As Integer = 0
Dim Item(3) As String
Dim DataArray(3, cntLines - 1) As String
Dim fileName As String = "woodsheets.txt"
Try
MsgBox(cntLines)
MsgBox(cntSplit)
Dim MyStream As New StreamReader(fileName)
For y As Integer = 0 To cntLines - 1
For x As Integer = 0 To cntSplit
DataArray(x, y) = MyStream.ReadLine.Split(";")
Next x
Next y
Catch ex As Exception
End Try
Return DataArray
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'bin\debug is de basic folder
getArray()
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click
Me.Close()
End Sub
Private Sub lstbxArticles_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstbxArticles.SelectedIndexChanged
Select Case lstbxArticles.SelectedIndex
Case 0
Case 1
Case 2
End Select
End Sub
End Class
Laatst bewerkt: