That way the b array will be resized to hold the Unicode data from "string" -- but then each character will be split across two bytes which is probably not what you want. This trick only works with Byte.
You also can do that:
Dim b() As Byte
b = StrConv(Text1.Text, vbFromUnicode)
Each letter will now occupy one byte, but the extended characters will be gone. Only do this if the current system code page contains the required characters.
You can copy the characters manually to an array:
Dim s() As String, i As Long
ReDim s(1 To Len(Text1.Text))
For i = 1 To UBound(s)
s(i) = Mid$(Text1.Text, i, 1)
Next
Or you can even avoid creating an array at all, becase Mid also serves as an indexer operator that changes a character in place, without copying or allocating anything:
Dim s As String
s = Text1.Text
Mid$(s, 3, 1) = "!"
VB6 is not a really good environment for multi-threaded applications. There is no out-of-the-box support, you need to delve into standard WinAPI functions. Take a look at this article, which provides quite a comprehensive sample:
Best Answer
That depends on what you eventually want to do.
You can, for example, do this in VB6:
That way the
b
array will be resized to hold the Unicode data from"string"
-- but then each character will be split across two bytes which is probably not what you want. This trick only works withByte
.You also can do that:
Each letter will now occupy one byte, but the extended characters will be gone. Only do this if the current system code page contains the required characters.
You can copy the characters manually to an array:
Or you can even avoid creating an array at all, becase
Mid
also serves as an indexer operator that changes a character in place, without copying or allocating anything: