Objects

Generic Objects are supported and are bags of Key-Value pairs, where a key points to a specific Value.

The following table describes the list of functions available for Objects:

Table 1. Objects

Object Name

Expression

Description

Creation

  • ObjectCreate(obj: object, property: string)
  • ObjectCreate(someObject, "property1" ) )

Example:

ObjectCreate(("count", "color", "isReady"), (23, "red", true))

The ObjectCreate creates an object with three keys (count, color, and isReady) with the following values: 23, "red" and True. The representation in JSON notation is as follows:

{

"count": 23,

"color": "red",

"isReady": true

}

Use the ObjectCreate function to create objects. One or more keys and a corresponding number of values can be passed.

Member Access

  • x.y
  • y of x

The key attribute can be used to access members of the object. Using the example above, myObject.count = 23, and myObject.color = “red”

Check the existence of object property

  • ObjectHasProperty(obj: object, property: string)
  • ObjectHasProperty (someObject, "property1" ) )

The function ObjectHasProperty can be used to check if a key exists in an object. It will return True if the key exists in the object; otherwise, it returns False.

Set the object property

ObjectSetProperty(obj: object, propertyName: string, propertyValue: any): object

The function ObjectSetProperty can be used to set the indicated value to the propertyValue provided and return the updated object.

Convert an object to a string

ObjectStringify(obj: object): string

The function ObjectStringify can be used to convert an object in JSON format to a string.

Assign the object values

ObjectAssign(targetObj: object, sourceObj: object): object

The function ObjectAssign can be used to assign all values in sourceObj to targetObj and returns targetObj.

Search an object

ObjectQuery(obj: object, expression: string)

The function ObjectQuery can be used to search for an item matching the expression in the object and return it. If the expression starts with $, a JSON query is made on the object. Otherwise, the expression is applied to elements of the array or object to find a match.

Convert a JSON string to an object

JSONParse(objString: string): object

The function JSONParse can be used to convert a JSON string into an object and returns the object.

Return a GUID

UUID()

The function UUID can be used to return a GUID value.