Discussion:
byte array to string in VB6
(too old to reply)
Kevin
2006-03-28 16:38:26 UTC
Permalink
Dear All

does windows has any API can do that
convert byte array into string in VB6?

dim b(5) as byte
dim b2() as byte
dim S as string

b(0) = 65
b(1) = 66
b(2) = 9
b(3) = 128
b(4) = 9
b(5) = 0

I tried below
S = strconv(b, vbUniCode),
b2 = strconv(S1, vbFromUnicode)
b(3) would be 63 not 128 ?

is there any API that can do convert byte array into string ?
b() -> S

Thanks for your help
Kevin
J French
2006-03-29 07:43:31 UTC
Permalink
Post by Kevin
Dear All
does windows has any API can do that
convert byte array into string in VB6?
dim b(5) as byte
dim b2() as byte
dim S as string
b(0) = 65
b(1) = 66
b(2) = 9
b(3) = 128
b(4) = 9
b(5) = 0
I tried below
S = strconv(b, vbUniCode),
b2 = strconv(S1, vbFromUnicode)
b(3) would be 63 not 128 ?
No - you have S1 not S in the conversion
Post by Kevin
is there any API that can do convert byte array into string ?
b() -> S
StrConv works just fine

I've just confirmed that, b2(3) is 128

You need to use Option Explicit
- that forces you to Declare variables

Loading...