No Spaces on JSON.Decode

Post Reply
Wackedout
Posts: 3
Joined: Monday 01st October 2018 1:31pm

No Spaces on JSON.Decode

Post by Wackedout » Monday 01st October 2018 1:36pm

When I get data using JSON.Decode the strings I have come out with no spaces in them...

i.e.

{
"Foo" : "Bar Bar Foo"
}

When I get the data for "Foo" it comes up as...
"BarBarFoo" instead of "Bar Bar Foo"

So am I forgetting something.

User avatar
cogier
Site Admin
Posts: 192
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: No Spaces on JSON.Decode

Post by cogier » Monday 01st October 2018 3:46pm

Hi Wackout and welcome to the forum.

Have a look at the attached code.
Image
Attachments
GUITest.tar.gz
(12.85 KiB) Downloaded 4 times

Wackedout
Posts: 3
Joined: Monday 01st October 2018 1:31pm

Re: No Spaces on JSON.Decode

Post by Wackedout » Monday 01st October 2018 4:33pm

Thanks for the welcome...

Ok I found out it was before the JSON.Decode, it seems to be
      FileIn = Open Filename For Input
        While Not Eof(FileIn)
          Input #FileIn, FileLine
          FileData = FileData & FileLine
        Wend
      Close FileIn
The "FileLine" var has no spaces. am I doing something wrong with the "Input" statement?

Wackedout
Posts: 3
Joined: Monday 01st October 2018 1:31pm

Re: No Spaces on JSON.Decode

Post by Wackedout » Monday 01st October 2018 4:41pm

OK I am an idiot (I guess) using "Line Input" instead of "Input" seems to fix it.

Thanks for the help! :D

Post Reply