On Oct 2, 7:14 am, "Cor Ligthert [MVP]" <notmyfirstn...@planet.nl>
wrote:
OO collection
Cor, that not exactly the thing i wanna do however i did take a look
at it and can maybe use it on another project, however i believe the
code below that i wrote will work but i have a problem with my string
array that i created. Below i parse out a file (sample.txt) i then
place the parsed data into an array of strings.
Public FileArray As New ArrayList
Public FileData As String()
Public EntireFile As String
Private Sub btnUploadFile_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnUploadFile.Click
Dim oFile As File
Dim oRead As System.IO.StreamReader
Dim EntireFile As String
'Dim FileData As String()
' Dim FileArray As New ArrayList
Try
oRead = oFile.OpenText("C:\sample.txt")
EntireFile = oRead.ReadToEnd()
FileData = Split(EntireFile, ",")
'FileArray.Add(FileData)
oRead.Close()
Catch ex As Exception
'Error Handling Code.
End Try
End Sub
After this code is executed i pass my FileArray into another event
handlers which is. This isn;t the complete code however it will break
at the line bitvalue= bitconverter.... I ran a similar program were i
would add my arralist.add(value) into the bitvalue equation that work
but when i run the code below i get the following.
"Overload resolution fail because no accessbile 'GetByte' can be
called without narrowing conversion. Public shared function GetByte
(value as Double) as Byte argument matching parameter value narrows
fro string to double".
Dim i As Integer = 0
Dim j As Integer = 0
ScaleLocation = 0
Try
For i = 0 To 1001
'convert to bytes
bitvalue = BitConverter.GetBytes(FileData(i))
bitlocation = BitConverter.GetBytes(ScaleLocation)
Next
Catch ex As Exception
' Warn the user.
MessageBox.Show("Upload Command is incorrect")
Finally
End Try
End Sub