Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Jsonize problem with Null
Jsonize problem with Null [message #36166] Tue, 08 May 2012 11:17 Go to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Mirek

This problem launches a NEVER() in ValueType:

Vector<Value> a, b;
a.Add();
String json = StoreAsJson(a);
LoadFromJson(b, json);

json String is set to "[null]".

It seems that while StoreAsJson() can save Vectors with Nulls, LoadFromJson() is reluctant to them.


Best regards
Iñaki
Re: Jsonize problem with Null [message #36167 is a reply to message #36166] Tue, 08 May 2012 12:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Tue, 08 May 2012 05:17

Hello Mirek

This problem launches a NEVER() in ValueType:

Vector<Value> a, b;
a.Add();
String json = StoreAsJson(a);
LoadFromJson(b, json);

json String is set to "[null]".

It seems that while StoreAsJson() can save Vectors with Nulls, LoadFromJson() is reluctant to them.


Weird, tried, unable to reproduce (in Linux 64 bit). And I do not even see the reason in the code.

What is your setup?
Re: Jsonize problem with Null [message #36168 is a reply to message #36167] Tue, 08 May 2012 13:31 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Sorry Mirek. What does "setup" means?

Best regards
Iñaki
Re: Jsonize problem with Null [message #36169 is a reply to message #36168] Tue, 08 May 2012 13:39 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Tue, 08 May 2012 07:31

Sorry Mirek. What does "setup" means?


Well, operating system, U++ revision, main package flags, ...
Re: Jsonize problem with Null [message #36170 is a reply to message #36169] Tue, 08 May 2012 14:04 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
MSC9, WinXP.

It is true. In Linux 32 bits it does not launches a NEVER().



Best regards
Iñaki
Re: Jsonize problem with Null [message #36173 is a reply to message #36170] Tue, 08 May 2012 18:02 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Tue, 08 May 2012 08:04

MSC9, WinXP.

It is true. In Linux 32 bits it does not launches a NEVER().




Tested with MSC, Win 7, still not reproduced. Are any other setup traits involved?

Can you please try with upptst/JSON? If it passes, you can alternatively try to create your own test package and submit to upptst? Or perhaps just add another test to upptst/JSON...

Mirek
Re: Jsonize problem with Null [message #36174 is a reply to message #36173] Tue, 08 May 2012 23:03 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Mirek

The problem appears compiling with GUI but not in CONSOLE.

I have tried to debug the same code in both manners and the difference is in Value::GetType("") when calling
int q = NameNdx().Find(name);
The GUI version sets q to 0 and the CONSOLE sets it with -1.


Best regards
Iñaki
Re: Jsonize problem with Null [message #36177 is a reply to message #36174] Wed, 09 May 2012 10:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks, hopefully fixed...
Re: Jsonize problem with Null [message #36179 is a reply to message #36177] Wed, 09 May 2012 11:58 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Thank you Mirek Smile .

Best regards
Iñaki
Previous Topic: Read CSV Line (Solved)
Next Topic: Custom array Jsonize
Goto Forum:
  


Current Time: Fri Mar 29 11:09:56 CET 2024

Total time taken to generate the page: 0.01514 seconds