Hey all,
I'm making a program that downloads my email. Problem is the email
contains carriage returns.
When my winsock _dataArrival event is triggered, I use winsock.getData
myBuffer. But during run-time when I hold my cursor over the variable
and the tooltip that shows the value comes up, myBuffer ends up only
containing "+OK email reads " and then two boxes (the character that
appears when there are cr's in the string).
I put in a clipboard.settext, and when i paste in notepad, I get the
entire email - just what I want. So mybuffer DOES contain the entire
email, but the instr() returns 0 when the email clearly contains the
text "saf".
My question is this: how can I get the whole email in a string?
Here's my code:
-----
Private Sub tcpSock_DataArrival(ByVal bytesTotal As Long)
Dim mybuffer As String
tcpSock.GetData mybuffer
commandLoc = InStr(1, mybuffer, "saf")
Clipboard.SetText (mybuffer)
-----
Result: commandLoc = 0
Thanks
IWP506
BOB - 09 Dec 2005 21:25 GMT
Try replacing the carriage return with a printable character
Dim mybuffer As String
tcpSock.GetData mybuffer
mybuffer = Replace(mybuffer, vbCr, "^")
commandLoc = InStr(1, mybuffer, "saf")
Clipboard.SetText (mybuffer)
> Hey all,
>
[quoted text clipped - 29 lines]
> Thanks
> IWP506