Re: JSON Format and VFP 8 or 9
- From: Thomas Ganss <tganss_at_t_dash_online_dot_de-remove-all-after-first-real-dash@xxxxxxxxx>
- Date: Fri, 11 Jan 2008 10:21:35 +0100
John Germany schrieb:
Hi everyone,
A supplier for my company has changed the format on a file that we regularly download and extract into our VFP 8 tables to the JSON format. See here for details...http://www.json.org/
Here is part of a sample file...
{page:'1',count:'10000',list:[{code:'10000',name:'Kits O-Ring Replacement',upc1:'037155399895',upc2:'',upc3:'',supp:'01809',mfg:'39989',uom:'KT',disc:false,comm:false,min:1,mult:1,pack:1}],total:34488}
Does anyone have any VFP code that will extract this file into a table? Any ideas without writing code using fget().
Thanks, John
Dunno how much data is sent that way, but if speed is not of the utmost essence, I'ld investigate if you can use an implementation which walks the object tree build from the json data.
As there are different jason dialects/implementations, chances are that you will receive sometime in the future data following slightly altered patterns. Instead of fine-tuning your parsing code you could (hopefully) build also an object from thatlist without no or at least much less code changes.
As long as it is only a couple of thousand elements it should not matter, but if you receive data high in the million range the speed penalty will probably prohibitive.
.
- References:
- JSON Format and VFP 8 or 9
- From: John Germany
- JSON Format and VFP 8 or 9
- Prev by Date: Devcon Prague 2008
- Next by Date: AW: Devcon Prague 2008
- Previous by thread: Re: JSON Format and VFP 8 or 9
- Next by thread: Re: JSON Format and VFP 8 or 9
- Index(es):
Relevant Pages
|