Operator Scope of Action:
Operator First Added:
From v9.2.0, the operator createAttribute(name[, type]) can create a new user attributes. If an attribute of the same name already exists, the operator has no effect and returns false. Otherwise, a new user attribute is created.
Optionally, a type argument may be supplied to determine the data type of the new attribute. Recognised values for type include:
dictionary. If no type valued is supplied, Tinderbox creates a String-type attribute.
A basic example using just the name argument, results in a new String-type attribute called 'MyList':
$MyBoolean = createAttribute("SomeList");
But, in the example above, the chosen name for the new attribute indicates the intended data-type should be of List data type. Therefore, use of the optional type argument would make more sense to signal user intent to Tinderbox more clearly:
$MyBoolean = createAttribute("SomeList", "list");
Again, the action results in a new String-type attribute called 'MyList'.