2017 June Release

Calculated identifiers / dynamic invocationPermanent link for this heading

Syntax

// Accessing a property using a calculated identifier
object.[expression]

// Invoking a use case using a calculated identifier
object.[expression](parameter, ...)


The selection operator [] can be used to specify an expression yielding a calculated identifier for accessing a property or invoking a use case.

For a calculated identifier, the expression specified in square brackets is evaluated, and then the result is interpreted as a property definition, entry key in a dictionary, an action or a use case.

Example

// Assigning a value to a calculated property
@attrdef = #APPDUCXSAMPLE@200.200:orderdate;
@order.[@attrdef] = coonow;

// Invoking a use case using a calculated identifier
@createinvoice = #APPDUCXSAMPLE@200.200:CreateInvoice;
@customer.[@createinvoice](@orders, &@invoice);

If the expression of the selection operator [] is a list of property definitions, then the list is interpreted as a path:

Example

// Accessing a value to a calculated property path
@attrdefs = [#objlock, #objlockedby, #objname]
string lockingusername = cooobj.[@attrdefs]


The selection operator [] can also be used with dictionaries, then the expression of the selection operator [] contains one or more strings identifying the entry keys in the dictionary.

Note: It is not possible to mix property definitions and strings in the expression of the selection operator [] to access object/aggregate properties and dictionary entries in one step.

Note: Only one action or use case can be specified, not a list.

Note: Dynamic invocation can also used with the -> operator invoking applications or dialogs (see chapter “Invoking use cases, virtual applications and dialogs".