Some old vb6 code I have laying around, might help you; if so great, if
not.. don't know been a long time since I screwed around with it.


Private Function GetTime(bytearray() As Byte, lstart As Long) As String
On Error Resume Next
 Dim value As Single
 Dim min As Long, hr As Long, sec As Long
 CopyMemory value, bytearray(lstart), 4

 hr = Int(value / 3600)
 min = Int((value / 60) Mod 60)  '(mod always truncates, so we can be upto
30sec off)
 sec = Int(value Mod 60)            'same issue
 GetTime = (hr & " hrs. " & min & " min. " & sec & " sec.")
End Function


-----Original Message-----
From: Alex Wasserman [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 14, 2004 6:44 AM
To: [EMAIL PROTECTED]
Subject: Re: [hlcoders] Re: Parsing Player Information


Hmm, it seems that in C#, br.ReadSingle() does all the work that I
need to know how to do. :) I'm not sure if each byte is added
together, or concatenated, and whatever; I just need to know how these
bytes are read and interpreted. As of now, I am Getting the ascii
value of each symbol, concatenating them together, and converting it
to a Single (Which I'm pretty sure is VB's equivalent to a float).
When I do this, I get huge numbers, such as 5.343266E+6, and when I
add them instead of concatenate, I get values that are just plain
wrong and not logical. For instance, it will say a player is connected
for 5:01, and 5 seconds later when I refresh, it might say 4:26...what
am I doing wrong? :(

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to