@Ajax
The code that I have used to generate the list of characters is:
Code:
Public Sub getCredit()
Dim result As String
Dim uid As String
uid = "uid=eventcontrol"
Dim pass As String
pass = "&pass=hidden"
Dim format As String
format = "&format=json"
Set Request = CreateObject("WinHttp.WinHttpRequest.5.1")
Request.Open "POST", "https://www.voodoosms.com/vapi/server/getCredit?" + uid + pass + format
Request.Send
result = Request.ResponseText
Dim I As Integer
For I = 1 To Len(result)
Debug.Print Mid(result, I, 1); Asc(Mid(result, I, 1))
Next I
MsgBox (result)
End Sub
Which returns (in full)
Code:
< 60
? 63
x 120
m 109
l 108
32
v 118
e 101
r 114
s 115
i 105
o 111
n 110
= 61
" 34
1 49
. 46
0 48
" 34
32
e 101
n 110
c 99
o 111
d 100
i 105
n 110
g 103
= 61
" 34
u 117
t 116
f 102
- 45
8 56
" 34
? 63
> 62
10
< 60
x 120
m 109
l 108
> 62
< 60
r 114
e 101
s 115
u 117
l 108
t 116
> 62
2 50
0 48
0 48
32
O 79
K 75
< 60
/ 47
r 114
e 101
s 115
u 117
l 108
t 116
> 62
< 60
c 99
r 114
e 101
d 100
i 105
t 116
> 62
2 50
0 48
8 56
7 55
. 46
0 48
0 48
0 48
0 48
< 60
/ 47
c 99
r 114
e 101
d 100
i 105
t 116
> 62
< 60
/ 47
x 120
m 109
l 108
> 62
10
The problem that I was having was with this line of code that you told me to try
Code:
if ubound(strA)=1 then msgbox iif(instr(strA(1),"<Credit>")=0,0,val(mid(strA(1), instr(strA(1)"<Credit>")+8)))
Full code that I am entering:
Code:
Public Sub getCredit()
Dim result As String
Dim uid As String
uid = "uid=eventcontrol"
Dim pass As String
pass = "&pass=hidden"
Dim format As String
format = "&format=json"
Set Request = CreateObject("WinHttp.WinHttpRequest.5.1")
Request.Open "POST", "https://www.voodoosms.com/vapi/server/getCredit?" + uid + pass + format
Request.Send
result = Request.ResponseText
Dim strA() As String
strA = Split(result, Chr(10)) ' check what the linefeed character is, might be something other than chr(10)
if ubound(strA)=1 then msgbox iif(instr(strA(1),"<Credit>")=0,0,val(mid(strA(1), instr(strA(1)"<Credit>")+8)))
MsgBox (result)
End Sub
Which returns a Syntax error.
Many thanks,
Leigh