Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Grok on July 08, 2004, 09:21 AM

Title: DebugOutput for Double-Byte
Post by: Grok on July 08, 2004, 09:21 AM
Just yesterday I realized that my DebugOutput function displays double-byte character sets as single-byte output.  If someone wants something to do, how about updating it to properly show doublebyte output?
Title: Re:DebugOutput for Double-Byte
Post by: TheMinistered on July 08, 2004, 06:20 PM
Sure, start with posting the code to method debugoutput in this thread.
Title: Re:DebugOutput for Double-Byte
Post by: Grok on July 08, 2004, 06:32 PM
Function DebugOutput (http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=728;start=msg5960#msg5960)
Title: Re:DebugOutput for Double-Byte
Post by: Adron on July 09, 2004, 03:31 AM
I think double-byte output should be optional. When you receive b.net packets, some of the low ascii might be interpreted as double-byte characters, and outputting those as such would ruin the use of it for displaying binary data / single-byte characters.
Title: Re:DebugOutput for Double-Byte
Post by: Tuberload on July 09, 2004, 01:03 PM
Quote from: Adron on July 09, 2004, 03:31 AM
I think double-byte output should be optional. When you receive b.net packets, some of the low ascii might be interpreted as double-byte characters, and outputting those as such would ruin the use of it for displaying binary data / single-byte characters.

I have very little knowledge of VB, but wouldn't you just convert the string to a byte array and handle it that way?
Title: Re:DebugOutput for Double-Byte
Post by: Adron on July 09, 2004, 01:59 PM
Quote from: Tuberload on July 09, 2004, 01:03 PM
Quote from: Adron on July 09, 2004, 03:31 AM
I think double-byte output should be optional. When you receive b.net packets, some of the low ascii might be interpreted as double-byte characters, and outputting those as such would ruin the use of it for displaying binary data / single-byte characters.

I have very little knowledge of VB, but wouldn't you just convert the string to a byte array and handle it that way?

Well, what I mean is that the contents of a packet can be interpreted either as single-byte characters, as is mostly the case with b.net, as multi-byte characters, or as double-byte characters, and this is protocol dependent. The DebugOutput function can't know how to interpret the data you pass it, so there must be a way of telling it.
Title: Re:DebugOutput for Double-Byte
Post by: TheMinistered on July 10, 2004, 06:13 PM
Here is a good way to tell it...

Public Enum CharacterType
   Single = 0
   Double = 1
   Multiple = 2
End Enum

Public Function DebugOutPut(... , Optional ByVal CharacterType as CharacterType = Single)