Tcl
Tcl
JSON Append String Array
See more JSON Examples
Demonstrates how to append an array of strings from a string table object.Note: This example uses the AppendStringTable method, which was introduced in Chilkat v9.5.0.67
Chilkat Tcl Downloads
load ./chilkat.dll
set json [new_CkJsonObject]
CkJsonObject_put_EmitCompact $json 0
CkJsonObject_AppendString $json "abc" "123"
set st [new_CkStringTable]
CkStringTable_Append $st "a"
CkStringTable_Append $st "b"
CkStringTable_Append $st "c"
CkStringTable_Append $st "d"
CkJsonObject_AppendStringArray $json "strArray" $st
puts [CkJsonObject_emit $json]
# Output:
# {
# "abc": "123",
# "strArray": [
# "a",
# "b",
# "c",
# "d"
# ]
# }
delete_CkJsonObject $json
delete_CkStringTable $st