Report Bugs Here

Moderator: Mmiscool

User avatar
By bugs
#60582 Trying (and failing) to get a string into an SQL database using wget with a fixed string & a variable.
Code: Select allwg$ = "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 alla$ = "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

User avatar
By Luc Volders
#60664 He bugs,

What branch are you using.
I just tried the unmodified copy of your program and here is my outcome:

Code: Select alla$ is z=z
length of a$ is 3

a$ is z=z
length of a$ is 3


I am using:
ESP Basic 3.0.Alpha 65

So in my opinion and version it just works fine.

Luc
User avatar
By bugs
#60675 Hi - many thanks for trying the code.

There is something strange going on - I am also using A65 and have even tried different browsers.

BUT - if I copy and paste the code as you did - it works correctly!
If I re-load the original program and even re-type it the error returns.
The only thing I can think now is something to do with a character set?
Tomorrow I will try copying the code into an editor that will give me character set information.

Again, thanks for the assistance.