patriciaxxx
Programmer
I have the following code which stores the string variable MyText in an array. The code works.
The following code writes the data from XMLHTTP.responseBody to a text file called MyText which is then returned in the function named MyFunction
Please can someone show me how to change this so that it uses an array and not a text file?
Code:
Set ADOStream = CreateObject("ADODB.Stream")
With ADOStream
.Charset = "utf-8": .Mode = 3: .Type = 2: .Open
.WriteText MyText: .Flush: .Position = 0
.Type = 1: .Read 3: ByteArrayToEncode = .Read(): .Close
End With
For i = 0 To UBound(ByteArrayToEncode)
iAsc = ByteArrayToEncode(i)
Select Case iAsc
Case 32: sTemp$ = "+"
Case 48 To 57, 65 To 90, 97 To 122: sTemp$ = Chr(ByteArrayToEncode(i))
Case Else: sTemp$ = "%" & Hex(iAsc)
End Select
txt$ = txt$ & sTemp$
Next
The following code writes the data from XMLHTTP.responseBody to a text file called MyText which is then returned in the function named MyFunction
Please can someone show me how to change this so that it uses an array and not a text file?
Code:
With ADOStream
.Type = 1: .Open: .Write XMLHTTP.responseBody
.SaveToFile LocalPath, 2
.Close: .Type = 2: .Charset = "utf-8": .Open:
.LoadFromFile MyText
MyFunction = .ReadText
End With