PowerBuilder
PowerBuilder
Create JSON Array of Strings
See more JSON Examples
Demonstrates how to create a JSON array of strings.Chilkat PowerBuilder Downloads
integer li_rc
oleobject loo_Jarr
// The goal of this example is to produce this:
// [
// "tag1",
// "tag2",
// "tag3"
// ]
loo_Jarr = create oleobject
li_rc = loo_Jarr.ConnectToNewObject("Chilkat.JsonArray")
if li_rc < 0 then
destroy loo_Jarr
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_Jarr.AddStringAt(-1,"tag1")
loo_Jarr.AddStringAt(-1,"tag2")
loo_Jarr.AddStringAt(-1,"tag3")
loo_Jarr.EmitCompact = 0
Write-Debug loo_Jarr.Emit()
destroy loo_Jarr