-
For megabyte interconversions of bytes and characters, Chr() and Asc() are pathetically slow (literally hours). The only way I see to get a Byte array efficiently converted into a string is to write the Byte array to a disk file and then read the same disk file into a string variable. That works O.K., but is there a way to execute this Byte array ---> string conversion without having to write a file? If not, there sure ought to be.
John Fritch
-
I don't know since when, but with vb6 this works:
Code:
Option Explicit
Private Sub Command1_Click()
Dim sText As String
Dim bAr() As Byte
Dim i As Integer
sText = "Frans C"
bAr = StrConv(sText, vbFromUnicode)
For i = 0 To UBound(bAr)
Debug.Print bAr(i)
Next
sText = ""
sText = StrConv(bAr, vbUnicode)
Debug.Print sText
End Sub
I didn't test the speed though.
[Edited by Frans C on 08-24-2000 at 03:08 PM]
-
Thanks, Frans.
Frans,
Thanks for your answer. Before testing your solution, I'd bet "dollars to donuts" that it beats writing to disk hands down. Sorry about misspelling your name in the revision to my other post.
John Fritch