PD Posted July 28, 2010 Author Share Posted July 28, 2010 I get RTE 7 here```Public Function ReadString(Optional MoveReadHead As Boolean = True) As String Dim sLength As Long Dim sBytes() As Byte sLength = ReadLong If sLength <= 0 Then Exit Function ReDim sBytes(sLength - 1) <------------------------------- Error Here! CopyMemory sBytes(0), Buffer(ReadHead), sLength ReadString = StrConv(sBytes, vbUnicode) If MoveReadHead Then ReadHead = ReadHead + sLengthEnd Function```It happens from time to time and its really annoying, I think its because sLength will equal a massive number, about 8 characters.Any help would be great. Link to comment Share on other sites More sharing options...
Robin Posted July 28, 2010 Share Posted July 28, 2010 You've screwed up one of your packets then. Remember they need to be read in the exact same order they're written. Link to comment Share on other sites More sharing options...
PD Posted July 28, 2010 Author Share Posted July 28, 2010 ye ive fixed it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now