json$(a$,"xx") , item must be followed by ':' immediatly .. otherwise ko

Here we can discuss about the problem found
Post Reply
TRS80_MKI
Posts: 30
Joined: Sun Apr 18, 2021 3:38 pm
Has thanked: 17 times
Been thanked: 6 times

json$(a$,"xx") , item must be followed by ':' immediatly .. otherwise ko

Post by TRS80_MKI »

Hi ,
i don't know if it's a bug or a bad use of json$ .

i use json$ to save an retrieve config in a file ..
a$ = a$ + |{|
a$ = a$ + |"FO1" : | + str$(fo1) +|,|
a$ = a$ + |"TR1" : | + str$(tr1) +|,|
a$ = a$ + |"FO2" : | + str$(fo2) +|,|
a$ = a$ + |"TR2" : | + str$(tr2) +|,|
a$ = a$ + |"FO3" : | + str$(fo3) +|,|
a$ = a$ + |"TR3" : | + str$(tr3) +|,|
a$ = a$ + |"FO4" : | + str$(fo4) +|,|
a$ = a$ + |"TR4" : | + str$(tr4)
a$ = a$ + |}|
when i save this config
{"FO1" : 5,"TR1" : 0,"FO2" : 0 ,"TR2" : 0 ,"FO3" : 0 ,"TR3" : 8 ,"FO4" : 0,"TR4" : 0 }
and use :
fo1 = val(json$(a$,"FO1"))
FO1 an other items are always zero !

but if i delete space between : , it's ok
{"FO1":5,"TR1":0,"FO2":0,"TR2":0,"FO3":0,"TR3":8,"FO4":0,"TR4":0}

have a nice day or nice nigth for all happy coder .. :D
@+
TRS80_MKI
User avatar
cicciocb
Site Admin
Posts: 2947
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 609 times
Been thanked: 2100 times
Contact:

Re: json$(a$,"xx") , item must be followed by ':' immediatly .. otherwise ko

Post by cicciocb »

Yes, it is probably a snag.

To be fixed ....
Post Reply