The util.JSONObject class / util.JSONObject methods |
Returns the type of a JSON object element.
util.JSONObject.getType( name STRING ) RETURNING type STRING
The getType() method returns the JSON data type name corresponding to the entry identified by the name passed as parameter.
This method can be used in conjunction with the name() and getLength() methods to read the entries of a JSON object.
IMPORT util MAIN DEFINE obj util.JSONObject LET obj = util.JSONObject.create() CALL obj.put("id", 8723) DISPLAY obj.getType("id") -- NUMBER CALL obj.put("name", "Brando") DISPLAY obj.getType("name") -- STRING DISPLAY obj.getType("undef") -- NULL END MAIN