[RESOLVED] Very wierd problem..
I've editted a packetsniffer which i downloaded from planet-source-code.
Basically I'm trying to parse the data coming into the computer
I've used this as the code;
VB Code:
Private Sub TCPDriver_RecievedPacket(IPHeader As clsIPHeader, TCPProtocol As clsTCPProtocol, Data As String)
Debug.Print Data
Debug.Print "-------------"
If InStr(1, Data, "÷") <> 0 Then
MsgBox Len(Data)
MsgBox Data
MsgBox Mid(Data, 1, Len(Data))
End If
The sub and modules themselves are not the problem, as I've used them before, but never had this problem.
Basically, Debug.print is printing out all the data incoming to the computer, and this works 100% fine.
When the If statement is triggered, the first messagebox gives a length of approx 40 something, but when the second messagebox appears, its value is only a few characters long
A sample of what 'Data' could be is
÷1 à dakkonblade àÜÿjô
If I were to msgbox data, it would return
÷1
The causes a problem, because when I use Instr(1,Data,"à"), it will always return 0.
I really have no idea what could be causing this, as debug.print returns the right value, Len(Data) returns the right value, but msgbox or validation checks are always cut off. :ehh:
Does anyone have an Idea of what's happening here?
Re: [RESOLVED] Very wierd problem..
Apparantly the null characters (chr(0)) do stop Instr(), I replaced them and all's well. Thanks guys :)