Problem with "=" in strings
Posted: Sat Jan 07, 2017 8:12 am
Trying (and failing) to get a string into an SQL database using wget with a fixed string & a variable.
Examining the combined string,
xxxx.co.uk/log.php?text = just_a_test
there are spaces added either side of the = sign so the command does not get transmitted correctly.
This simple code shows the error in the length of the second string:-
Code: Select all
wg$ = "xxxx.co.uk/log.php?text="
a$ = "just_a_test"
b$ = wg$ & a$
rec = wget(b$)
Examining the combined string,
xxxx.co.uk/log.php?text = just_a_test
there are spaces added either side of the = sign so the command does not get transmitted correctly.
This simple code shows the error in the length of the second string:-
Code: Select all
a$ = "z=z"
wprint "a$ is "
wprint a$
wprint "<br>"
'displays correct length of 3 characters
wprint "length of a$ is "
wprint len(a$)
wprint "<br>"
wprint "<br>"
b$ = "="
a$ = "z" & b$ & "z"
wprint "a$ is "
wprint a$
wprint "<br>"
'displays length of 5 with the additional spaces
wprint "length of a$ is "
wprint len(a$)
wprint "<br>"
end