Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic json examples
#5
this is the activeX version of chilkat in qm

goto Download the Chilkat ActiveX

install 32bit version i believe

Function ChilkatActivexExamples
Code:
Copy      Help
out
typelib Chilkat_v9_5_0 {004CB902-F437-4D01-BD85-9E18836DA5C2} 1.0
Chilkat_v9_5_0.ChilkatJsonArray ja._create
Chilkat_v9_5_0.ChilkatJsonObject jo._create
Chilkat_v9_5_0.ChilkatJsonObject json._create

str filename.expandpath("$desktop$\test.json")
jo.LoadFile(filename)
jo.EmitCompact=0
out "original json with formatting"
out jo.Emit
out "Remove whole json object userContextId': 3 and output result"
ja= jo.ArrayOf("identities")
ja.DeleteAt(2)
out jo.Emit
out "Add object and output result"
ja.AddObjectAt(2)
json=jo.ArrayOf("identities").ObjectAt(2)
json.SetStringOf("userContextId","7")
json.SetBoolOf("public",1)
json.SetStringOf("icon","doc");
json.SetStringOf("color","red");
json.SetStringOf("name","test 7");
json.SetStringOf("accessKey","123");
out jo.Emit
json=jo.ArrayOf("identities").ObjectAt(0)
out "Modify key-value pair, of ''userContextId'': 1,''  ---> modify name from ''test 1'' to ''test 1B''"
json.UpdateString("name","test 1B");
out jo.Emit
jo.WriteFile(filename)
out "finished"


Messages In This Thread
Basic json examples - by r0n - 06-14-2021, 09:19 PM
RE: Basic json examples - by Gintaras - 06-15-2021, 07:25 PM
RE: Basic json examples - by r0n - 06-15-2021, 07:43 PM
RE: Basic json examples - by Kevin - 06-16-2021, 09:23 PM
RE: Basic json examples - by Kevin - 06-16-2021, 11:12 PM
RE: Basic json examples - by r0n - 06-17-2021, 05:31 AM
RE: Basic json examples - by stupomer - 04-07-2022, 05:10 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)