BytesToString
Previous  Next

Returns a string from an array of bytes.
Syntax: BytesToString (buffer As Byte(), index As Int32, count As Int32) As String

BytesToString converts each byte in the array to a character based on its ASCII value.
buffer - An array of bytes.
index - The index of the first byte which will be converted.
count - Number of bytes to convert.
Note: buffer will stay unchanged.

Example:
'First add a Bitwise object named bit.
Sub Globals
      Dim buffer(5) as Byte
End Sub

Sub App_Start
      bit.New1
      buffer(0) = 65
      buffer(1) = 66
      buffer(2) = 67
      buffer(3) = 68
      buffer(4) = 69
      msgbox(bit.BytesToString(buffer(), 0, 5)) 'Will display "ABCDE"
End Sub