Unsupported content This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

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:

$STR=mapslots($OBJECTS,$FORMAT,$EXPRS)

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.

The values resulting from the evaluation of the expressions, have to be compliant with the specified format. Incompatible expression evaluation results, can cause a crash of the cell.

mapslots/4 example

$STR = mapslots([$E,$D],'Event %s is associated to data %s',
['$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.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*