Using the Pbfunc tool to parse JSON in PowerBuilder, you only need to call the getattribute method to get
- Parsing JSON in Unicode format:
N_pbfunc_json lnv_jsonlnv_json.of_parse ('{"test3": "\u6735\u6735\u8d1d\u8d1d\u5a74\u513f\ u978b "}")string ls_vallnv_json.getattribute ("test3 ", Ls_val)
Ls_val back for Dora baby shoes
N_pbfunc_json Lnv_jsonlnv_json.of_parse ('{"Test1": 122.9, "test2": 34422, "test3": "SDSD is how much a", "obj": {"AA": "Test 1"}}')stringLs_test2//gets the value of the Test2Lnv_json.getattribute ("test2", Ls_test2)decimalLdc_test1//gets the value of the Test1Lnv_json.getattribute ("test1", Ldc_test1)stringAA//directly takes the value of AA below the OJB object, ":" As the default object delimiterLnv_json.getattribute ("Obj:aa", AA)
Results after parsing
demo:http://download.csdn.net/detail/my_aa/9465068
Using Pbfunc to parse JSON objects in PowerBuilder