Scholieren.com forum

Scholieren.com forum (https://forum.scholieren.com/index.php)
-   Software & Hardware (https://forum.scholieren.com/forumdisplay.php?f=20)
-   -   VB - LST problem (https://forum.scholieren.com/showthread.php?t=340133)

dafelix 13-01-2003 11:21

VB - LST problem
 
(Sorry dat het (fout) engels is, maar ik doe ff copy van ander (engels) board) :

Ok already made a MSN, but that one is fucked up, so i'm building one again. There is nothing wrong with the protocol or MSN-server, but my VB is doing strange when it gets the LST.

Im splitting the lines, so the HandleData function gets lines and not a gigantic amount of TXT. The code im using for that is:

Code:

Private Sub SckMSN_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim TempLen As Integer
Dim Temp As String
 
SckMSN.GetData strData

Do While Len(strData) > 0
 TempLen = InStr(1, strData, vbCrLf)
 If TempLen > 0 And strData <> vbCrLf Then
  Temp = Mid(strData, 1, TempLen - 1)
  HandleData (Temp)
 Else
  If Len(strData) > 0 And strData <> vbCrLf Then
  HandleData (Temp)
  End If
 Exit Do
 End If
 strData = Mid(strData, (TempLen + 2))
Loop
End Sub

When im debugging it works perfect, but when i run the program "normally" i get this:

NEWLIN > LST 6 RL 958 19 45 ***_***@hotmail.com «-(¯`A/v\Y´¯)-«
NEWLIN > LST 6 RL 958 20 45 **********1985_@hotmail.com -(THE NAME)-
NEWLIN > LST 6 RL 958 20 45 **********1985_@hotmail.com --(THE NAME)-
NEWLIN > hotmail.com =--paul(H)--=
NEWLIN > LST 6 RL 958 22 45 ***************@hotmail.com f*ck%20the%20world

So i get "LST 6 RL 20" 2 times, and "LST 6 RL 21" Only the last part of it. WTF is wrong? and how to solve this? (i cant solve it because in debug-mode it works fine :( )

GrayBurn 13-01-2003 12:27

Je zit in een DO .. LOOP je binnengekomen data te behandelen.

Als de MSN server jou data stuurt, kan het zijn dat je niet in een keer alles binnenkrijgt ..

.. waarom doe jij een handledata() als er data zonder een linefeed is binnengekomen?

Code:

  If Len(strData) > 0 And strData <> vbCrLf Then
  HandleData (Temp)
  End If

Ik snap de logica van dit stukje code niet; wat je hiermee wilt bereiken. :S

Als je geen linefeed in je incoming data hebt, moet je het event verlaten; die data bewaren en wachten tot het event opnieuw getriggered word.

dafelix 13-01-2003 12:52

thanks m8, idd sloeg niet ergens op, was een fout die ik uit me andere MSN heb overgenomen. hij werkt nu hoor :) (denk ik)


Alle tijden zijn GMT +1. Het is nu 16:17.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.