mapslots/4—format a series of expressions that refer to event and data objects into a string
The mapslots/4 function formats a series of expressions that refer to event and data objects into a string. The syntax for this function is as follows:
mapslots/4 arguments
Argument | Mode | Type | Description |
---|---|---|---|
$OBJECTS | Input | LIST_OF OBJECT | Specifies the list of event or data objects |
$FORMAT | Input | STRING | Specifies the format to be applied |
$EXPRS | Input | LIST_OF STRING | Specifies the expressions to be evaluated |
$STR | Output | STRING | Resulting string |
Use the mapslots/4 to evaluate a list of expressions $EXPRS, referring to objects from $OBJECTS, and to format them into string $STR by using format $FORMAT.
The format specification for mapslots/4 is the same as for the C language sprintf() function.
The expressions given in $EXPRS are compiled and evaluated at the moment the primitive is called, each time mapslots/4 is called. Within these expressions, the objects from $OBJECTS can be referenced as $1, $2,... for the first, second,... element of the object list.
mapslots/4 example
['$1.mc_ueid','$2.mc_udid']);
A message is produced stating that an event and data object are associated. The event and data object are passed as $E and $D, respectively, in the first argument. The list of expressions contains two expressions that result in a string. The first one retrieves the mc_ueid slot of the event object, the second one retrieves the mc_udid of the data object.