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.
No Spaces on JSON.Decode
- cogier
- Site Admin
- Posts: 1129
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: No Spaces on JSON.Decode
Hi Wackout and welcome to the forum.
Have a look at the attached code.
Have a look at the attached code.
- Attachments
-
- GUITest.tar.gz
- (12.85 KiB) Downloaded 549 times
Re: No Spaces on JSON.Decode
Thanks for the welcome...
Ok I found out it was before the JSON.Decode, it seems to be
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?Re: No Spaces on JSON.Decode
OK I am an idiot (I guess) using "Line Input" instead of "Input" seems to fix it.
Thanks for the help!
Thanks for the help!
- grayghost4
- Posts: 187
- Joined: Wednesday 5th December 2018 5:00am
- Location: Marengo, Illinois usa
Re: No Spaces on JSON.Decode
I am also working with json and havine trouble indexing a collection.
listofdata = JSON.Decode(File.Load("~/airplane files/Conscendo S2.srm"))
myindex = "data" & "," & "autopilot" & "," & "altHoldRate"
Print listofdata.count
Print listofdata.Length
Print listofdata[myindex]
End
what am I doing wrong
listofdata = JSON.Decode(File.Load("~/airplane files/Conscendo S2.srm"))
myindex = "data" & "," & "autopilot" & "," & "altHoldRate"
Print listofdata.count
Print listofdata.Length
Print listofdata[myindex]
End
what am I doing wrong