Sample code for 30+ languages & platforms
Classic ASP

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 Classic ASP Downloads

Classic ASP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
set json = Server.CreateObject("Chilkat.JsonObject")
json.EmitCompact = 0

success = json.AppendString("abc","123")

set st = Server.CreateObject("Chilkat.StringTable")
success = st.Append("a")
success = st.Append("b")
success = st.Append("c")
success = st.Append("d")

success = json.AppendStringArray("strArray",st)

Response.Write "<pre>" & Server.HTMLEncode( json.Emit()) & "</pre>"

' Output:

' 	{
' 	  "abc": "123",
' 	  "strArray": [
' 	    "a",
' 	    "b",
' 	    "c",
' 	    "d"
' 	  ]
' 	}

%>
</body>
</html>