Use JSON Object in Appeon PowerServer 2016 Older

More
2 years 3 weeks ago #417 by Sang Chul Song
Sang Chul Song created the code: Use JSON Object in Appeon PowerServer 2016 Older
Use Json Object in PowerBuilder 2019 Older
this json object use PowerServer 2016 OR Older

reference github.com/xlat/pbjson

Example
n_mcf_json ln_json, ln_j1, ln_j2, ln_j3
n_mcf_jsonarray ln_array
n_mcf_jsonparser ln_parser
ln_json = Create n_mcf_json
ln_j1 = Create n_mcf_json

ln_array = Create n_mcf_jsonarray

ln_json.put("test1", 'test, customer')
ln_json.put("test2", 'test:~r~ncustomer')
ln_json.put("test3", 'test "customer"')
ln_json.put("test4", 'test {customer}')
ln_json.put("test5", 'test [customer]')

ln_array.add(ln_json)

ln_json.reset()
ln_json.put("test6", 'test,customer')
ln_json.put("test7", 'test:customer')
ln_json.put("test8", 'test "customer')
ln_json.put("test9", 'test {customer}')
ln_json.put("test10", 'test [customer]')

ln_array.add(ln_json)

ln_json.reset()
ln_json.put("test11", 'test,customer')
ln_json.put("test12", 'test:customer')
ln_json.put("test13", 'test "custome')
ln_json.put("test14", 'test {customer}')
ln_json.put("test15", 'test [customer]')

ln_array.add(ln_json)

ln_json.reset()
ln_json.put("test16", "test,customer")
ln_json.put("test17", "test:customer")
ln_json.put("test18", "test ~"customer")
ln_json.put("test19", "test {customer}")
ln_json.put("test20", "test [customer]")

ln_array.add(ln_json)

ln_json.reset()
ln_json.put("test21", "test,customer~"")
ln_json.put("test22", "test:customer~"")
ln_json.put("test23", "test ~"customer~"")
ln_json.put("test24", "test {customer}")
ln_json.put("test25", "test [customer]")

ln_array.add(ln_json)

ln_j1.put("ccc", ln_array)

messageBox("", ln_j1.toJsonString())

ln_j3 = ln_parser.parse(ln_j1.toJsonString())
IF Not IsValid(ln_j3) THEN return
messageBox("", ln_j3.toJsonString())

This message has an attachment file.
Please log in or register to see it.

Please Log in or Create an account to join the conversation.

Moderators: Appeon Administrator