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



Bradley,

Really feeling slow today.

So, using your example I get a valid pointer to "Equipment". So far so good.

I process the loop. The keys I see are the sub nodes (?) EquipmentHeader & Location.

Now I need to process the elements within each sub node (first - UnitInstallDateTime).

I thought I could use YAJL_object_find against either the "list" or "node" pointers. Wrong.

docNode = yajl_stmf_load_tree('/tmp/JLGCSKBAS.json': errMsg );
if errMsg <> '';
// handle error
endif;
node = YAJL_object_find(docNode: 'Fleet');
list = YAJL_object_find(node: 'Equipment');
i = 0;
dow YAJL_ARRAY_LOOP( list: i: node );
j = 0;
dow YAJL_OBJECT_LOOP( node: j: key: val);
exsr load_subfield;
enddo;
enddo;

begsr load_subfield;

select;
when key = 'EquipmentHeader';
val = YAJL_object_find(node:'UnitInstallDateTime');
val = YAJL_object_find(list:'UnitInstallDateTime');
result.list(i).I_TJMAK = yajl_get_string(val);
endsl;
endsr;


Thx.

Scott

************Beginning of data**************
{"Fleet":{"Equipment":[{"EquipmentHeader":{"UnitInstallDateTime":"2019-04-26T15:
07:24.0000000+00:00","Make":"Skytrak","Model":"6042","EquipmentID":"181195","Ser
ialNumber":"0160095778"},"Location":{"Latitude":30.169664,"Longitude":-97.78923,
"DateTime":"2019-06-19T00:00:00.0000000+00:00"}},



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.