× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Yes, I thought that everybody agreed that {:"abcde"} is invalid so I did

abc = '{"" : "abcdef", "aaa" : "DEFGH"}'
abcJson = JSON.parse(abc)

<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virusfri.
www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#m_7297842560168873065_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Fri, Jan 19, 2018 at 9:57 AM, john erps <jacobus.erps@xxxxxxxxx> wrote:

If i do JSON.parse('{ : "x" }' in chrome i get "unexpected token at
position 2"


On Fri, Jan 19, 2018 at 2:21 AM, Jon Paris <jon.paris@xxxxxxxxxxxxxx>
wrote:

Agreed. I was juts pointing out that a null name is valid in JSON and
that that appears to be what the parser is treating the omission as
meaning. But I'm darned if I can think of why that might be useful other
than in the context of an unnamed item.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jan 18, 2018, at 6:45 PM, Craig Richards <craig@xxxxxxxxxxxxxxxx>
wrote:

Maybe so Jon,

But while I can see how a null value might possibly be used, the
requirement for a null key escapes me. To my mind that’s a bit like
having
a based variable but the pointer is null...

On Thu, 18 Jan 2018 at 18:42, Jon Paris <jon.paris@xxxxxxxxxxxxxx>
wrote:

I'm guessing it is treating the missing name as a null. i.e. if you
put
""
in front of the : it is accepted as valid.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jan 18, 2018, at 12:46 PM, Craig Richards <craig@xxxxxxxxxxxxxxxx

wrote:

IS JSON OBJECT is telling me this is valid:

{: "KD", "intkRef": "Craig Intake 001",
"items": [{"itemRef": "Ref_001", "manuDate": "2015-11-21", "altRef":
"Alt_001", "itemText": "Text 001", "UOM": "SM", "weight": 0.25,
"width":
5.0, "length": 25.5, "prodCode": "Product 1",
"colourCode": "Colour 1", "colourText": "Colour Text 1", "dyeLot":
"Dye
Lot
1", "QCHold": "Q", "faultCode": "abc", "grade": "Gd1", "stockType":
"s",
"tareWeight": 1.01, "comments": "no comment"},
{"itemRef": "Ref_002", "manuDate": "2018-01-28", "altRef": "Alt_002",
"itemText": "Text 002", "UOM": "SM", "weight": 0.35, "width": 4.5,
"length": 24.0, "prodCode": "Product 2",
"colourCode": "Colour 2", "colourText": "Colour Text 2", "dyeLot":
"Dye
Lot
2", "QCHold": "C", "faultCode": "abd", "tareWeight": 1.11,
"comments":
"still no comment"}] }

I dropped the key out of the first key-value pair.
( e.g should have been:
"warehouse" : "KD"
not
: "KD"
)

JSLINT agrees with me that it isn't a valid JSON object.

Anyone else come across this?

regards,
Craig
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.