Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Michael Johnson
  
 
 
 Michael Johnson
 To: Tore Bleken
  Where is Tore Bleken?
 Stokke
 Norway
 Tore Bleken
 Tags
Subject: RE: Json to Table
Thread ID: 394157 Message ID: 394198 # Views: 61 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Web Applications
Date: Tuesday, December 31, 2013 1:57:44 PM         
   


> http://www.sweetpotatosoftware.com/SPSBlog/PermaLink,guid,5f96efd7-f350-4bc8-86c5-caffd9e833eb.aspx
>

Thanks for Tore.

SPS' Json is use Json.fll.
I need pure VFP Code.

I Download vfpjson at http://code.google.com/p/vfpjson/downloads/list/

How to Extract Data with Loop

My Code id below

Clear
*!*    vfpjson at : http://code.google.com/p/vfpjson/downloads/list

*!*    cStr = Filetostr("PAM25.Txt")
*!*    cStr = Chrtran(cStr, "[", "")
*!*    cStr = Chrtran(cStr, "]", "")
TEXT TO cStr  NOSHOW
    {
        "aqi": 82,
        "area": "Japan",
        "pm2_5": 51,
        "pm2_5_24h": 86,
        "position_name": "Tokyo",
        "primary_pollutant": "Particulate Matter(PM2.5)",
        "quality": "General",
        "station_code": "1367A",
        "time_point": "2013-03-07T19:00:00Z"
    },
    {
        "aqi": 82,
        "area": "Japan",
        "pm2_5": 31,
        "pm2_5_24h": 60,
        "position_name": "Kyoto",
        "primary_pollutant": "SO2",
        "quality": "Slightly Polluted",
        "station_code": "1369A",
        "time_point": "2013-03-07T19:00:00Z"
    },
    {
        "aqi": 82,
        "area": "Japan",
        "pm2_5": 131,
        "pm2_5_24h": 160,
        "position_name": "Sapporo",
        "primary_pollutant": "Hazardous",
        "quality": "Bad",
        "station_code": "1368A",
        "time_point": "2013-03-07T19:00:00Z"
    },
ENDTEXT

oJson = Newobject('json','json.prg')
oCliente = oJson.decode( @cStr )

*!*    For Loop
? oCliente.Get('aqi')
? oCliente.Get('area')
? oCliente.Get('pm2_5')
? oCliente.Get('pm2_5_24h')
? oCliente.Get('quality')
? oCliente.Get('position_name')
? oCliente.Get('time_point')
*!*    Endfor




Thanks again.

- Tuberose
.

ENTIRE THREAD

Json to Table Posted by michael johnson @ 12/31/2013 3:35:44 AM
RE: Json to Table Posted by Tore Bleken @ 12/31/2013 10:26:44 AM
RE: Json to Table Posted by michael johnson @ 12/31/2013 1:57:44 PM
RE: Json to Table Posted by Tore Bleken @ 12/31/2013 2:08:36 PM
RE: Json to Table Posted by michael johnson @ 12/31/2013 4:29:50 PM
RE: Json to Table Posted by David Mustakim @ 12/31/2013 4:37:25 PM
RE: Json to Table Posted by michael johnson @ 12/31/2013 4:48:41 PM
RE: Json to Table Posted by David Mustakim @ 12/31/2013 4:59:36 PM
RE: Json to Table Posted by michael johnson @ 12/31/2013 5:06:32 PM
RE: Json to Table Posted by David Mustakim @ 12/31/2013 5:11:48 PM
RE: Json to Table Posted by michael johnson @ 12/31/2013 5:19:49 PM
RE: Json to Table Posted by David Mustakim @ 12/31/2013 5:43:46 PM
RE: Json to Table Posted by Tore Bleken @ 12/31/2013 6:09:03 PM
RE: Json to Table Posted by michael johnson @ 1/1/2014 6:18:50 AM
RE: Json to Table Posted by Tore Bleken @ 1/1/2014 1:30:55 PM
RE: Json to Table Posted by michael johnson @ 1/1/2014 3:02:10 PM
RE: Json to Table Posted by Vilhelm-Ion Praisach @ 1/1/2014 4:34:24 PM
RE: Json to Table Posted by michael johnson @ 1/2/2014 6:31:48 AM
RE: Json to Table Posted by Vilhelm-Ion Praisach @ 1/2/2014 1:11:25 PM