Using Pbfunc to parse JSON objects in PowerBuilder

Source: Internet
Author: User

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

    • Parsing nested JSON
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.