Sample code for 30+ languages & platforms
AutoIt

JSON PathPrefix Example

Demonstrates the JSON object's PathPrefix property.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

$oJson = ObjCreate("Chilkat.JsonObject")

$oJson.PathPrefix = "company.billing."

$oJson.UpdateString("company_name","TechNova Solutions Inc.")
$oJson.UpdateString("address_line_1","123 Innovation Drive")
$oJson.UpdateString("address_line_2","Suite 450")
$oJson.UpdateString("city","Seattle")
$oJson.UpdateString("state_province","WA")
$oJson.UpdateString("postal_code","98101")
$oJson.UpdateString("country","USA")

$oJson.EmitCompact = False

ConsoleWrite($oJson.Emit() & @CRLF)

; Result:

; {
;   "company": {
;     "billing": {
;       "company_name": "TechNova Solutions Inc.",
;       "address_line_1": "123 Innovation Drive",
;       "address_line_2": "Suite 450",
;       "city": "Seattle",
;       "state_province": "WA",
;       "postal_code": "98101",
;       "country": "USA"
;     }
;   }
; }

Local $sCity = $oJson.StringOf("city")
ConsoleWrite("city = " & $sCity & @CRLF)