Note: This statement is not available in the Add Statement dialog box or the Statements pane.
Returns the property names for a JSONObject.
Syntax
GetPropertyNames()
Supported objects
Return value
| Value | Description |
|---|---|
| Value | JSONObject property names. |
Example
jsonObject = JSONNewObject()
' Adds the values to the JSONObject
jsonObject.SetValue("PropertyName1", 1)
jsonObject.SetValue("PropertyName2", 2)
' Returns array that contains "PropertyName1" and "PropertyName2"
arrayVal = jsonObject.GetPropertyNames()
PrintLn("Should be 2: " & ArraySize(arrayVal, 1))
PrintLn("Should be \"PropertyName1\": " & arrayVal(1))
PrintLn("Should be \"PropertyName2\": " & arrayVal(2))