cmdolcet69 said:
I have a value bieng added into my array that displays correctly in
the textbox as 0.10 however when i read from my array into an excel
spreadsheet I get the value 0.10 [][] how can I get rid of the [][]
characters????
Is your textbox a multiline textbox? If so the chars you see may be a
carriage return / line feed. Perhaps showing some code might help.
LS
Lloyd, here the code the STRdata is tring to convert the
end.GetString(mabtRxbuf) but the string value coming over is for
example "0.10[][]
what is going on?
Public Function ReadValidatedData(ByVal Bytes2Read As Integer) As
Integer
Dim iReadChars, iRc As Integer
Dim strdata as string
' If Bytes2Read not specified uses Buffersize
If Bytes2Read = 0 Then Bytes2Read = miBufferSize
If mhRS = -1 Then
Throw New ApplicationException( _
"Please initialize and open port before using this
method")
Else
' Creates an event for overlapped operations
If meMode = Mode.Overlapped Then
pHandleOverlappedRead(Bytes2Read)
Else
' Non overlapped mode
ReDim mabtRxBuf(Bytes2Read - 1)
iRc = ReadFile(mhRS, mabtRxBuf, Bytes2Read,
iReadChars, Nothing)
Dim enc As New System.Text.ASCIIEncoding
STRdata = enc.GetString(mabtRxBuf)
If iRc = 0 Then
' Read Error
Throw New ApplicationException( _
"ReadFile error " & iRc.ToString)
Else
'commmented out because of issues with overflow
' Handles timeout or returns input chars
'If iReadChars < Bytes2Read Then
'Throw New IOTimeoutException("Timeout error")
'Else
mbWaitOnRead = True
Return (iReadChars)
End If
End If
End If
End Function