× 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.



There is no node named success in your JSON. That's why node is null.

Instead, you have an array of objects with name, life, term and party. You
need to process through that array and for each object individually.

Processing arrays with YAJL is easy, and I think Jon already posted an
example of how to handle that. It should be in the archives or an older
thread.

Here's a great PDF from Scott that maybe you should spend some time on to
understand what JSON is, how it works, and how to use YAJL with it:

http://www.scottklement.com/presentations/Working%20with%20JSON%20in%20RPG.pdf

Bradley V. Stone
www.bvstools.com
MAILTOOL Benefit #11 <https://www.bvstools.com/mailtool.html>: Save Emails
- Save emails that are sent out at a global, user or individual email
level.

On Fri, Sep 1, 2017 at 10:22 PM, Booth Martin <booth@xxxxxxxxxxxx> wrote:

Next, I used a json file that had no errors when verified with the link
you supplied, Bradley. The affected code segment is:

docNode = yajl_stmf_load_tree(%trim(wIFSFileName): errMsg );
if errMsg = ' ';
node = YAJL_object_find(docNode: 'success');
result.success = YAJL_is_true(node);

docNode has a value.
errMsg is blank.
node is *null.
result.success = "0"

I am suspicious that node being *null is not a good thing?

The first few lines of the json file are:
[
{"name":"George Washington", "life":"1732-1799", "term":"1789-04-30 to
1797-03-04", "party":"No Party"},
{"name":"John Adams", "life":"1735-1826", "term":"1797-03-04 to
1801-03-04", "party":"Federalist"},
{"name":"Thomas Jefferson", "life":"1743-1826", "term":"1801-03-04 to
1809-03-04", "party":"Democratic-Republican"},
...
]

The application as a web page, is US Presidents <ventures.martinvt.com>


On 9/1/2017 8:09 AM, Bradley Stone wrote:

Booth,

...

Also, when asking for help, you may want to include code and the json
itself.


Bradley V. Stone
www.bvstools.com


--
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: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://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 ...

Follow-Ups:
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.