xpfAggregateToString
FUNCTION xpfAggregateToString(aggrIdOrInstanceHashTableIndex : GENERIC; options : INTEGER; attributeIdOrAttributeName : GENERIC; stringDelimiter : STRING; defaultStringForUnsetValue : STRING; integerAndInstancePrintFormat : STRING; stringPrefix : STRING; stringSuffix : STRING; elementIndex : INTEGER; elements : INTEGER) resultString : STRING;
This function constructs (concatenates) a string from a given set of elements. The actual elements can be in an aggregate or in an EDMinstanceHashTable. This function will perform the "string concatenation" operation with better performance and "less consumption" of virtual memory than using ordinary string concatenation operations (str1 + str2). This function may be invoked with a variable number of arguments, i.e., it may be invoked with 1 to 10 number of arguments.
Â
Arguments
1 | Type | Name | Comment |
2 | GENERIC | aggrIdOrInstanceHashTableIndex | Â This argument defines the elements that should be used to construct the resulting string. It can be an aggregateId or an instanceHashTableIndex. When an aggregateId is specified, the actual aggregate elements must be either INSTANCE, INTEGER or STRING. When the aggregate elements are INTEGER data type it will be transferred to a string by a "printf" operation. INSTANCE elements value can be handled exactly like an INTEGER value, or by specifying an attributeName or attributeId in the "attributeIdOrAttributeName" argument, the actual instance attribute value will be used to construct the result string. The legal data types of such an attribute are STRING, INSTANCE or INTEGER. When an INTEGER or INSTANCE value is transferred to a string, the actual "format specification" can be specified in the "integerAndInstancePrintFormat" argument. The default for this "format specification" is "%lu", when the "aggrIdOrInstanceHashTableIndex" is specified as an instanceHashTableIndex, the operation will behave in the same way as for an aggregate of instances. |
3 | INTEGER | options | Optional options of representation (see below). |
4 | GENERIC | attributeIdOrAttributeName | Optional attribute name/id to be used for instances representation. By default instances are represented by number of instance id. The data type of the actual attribute data value must be STRING, INSTANCE or INTEGER. The "attributeIdOrAttributeName" can be specified by the attribute name or by the attributeId. |
5 | STRING | stringDelimiter | Optional delimiter between aggregate elements in string representation. By default is " " (white space). When no delimiter is wanted, an empty string ('') must be specified, |
6 | STRING | defaultStringForUnsetValue | Optional string to represent unset elements. By default '?'. |
7 | STRING | integerAndInstancePrintFormat | Optional format to represent elements of INTEGER and INSTANCE types. By default value is "%lu". |
8 | STRING | stringPrefix | Optional prefix before every element of the aggregate in result string. By default - no prefix. |
9 | STRING | stringSuffix | Optional suffix after every element of the aggregate in result string. By default - no suffix |
10 | INTEGER | elementIndex | Optional index of element to be represented as first in result string. By default result string represent elements starting from the first.. This argument has no effect when the "aggrIdOrInstanceHashTableIndex" argument specifies an EDMinstanceHashTable. |
11 | INTEGER | elements | Optional number of represented elements. By default all aggregate elements starting from elementIndex are represented in result string. This argument has no effect when the "aggrIdOrInstanceHashTableIndex" argument specifies an EDMinstanceHashTable. |
Return Value
Â
Type | Name | Comment |
STRING | resultString | The constructed (concatenated) string will be return when the function is successfully performed. When the function fails,INDETERMINATE (?) will be returned. Exception handling should be used to handle error conditions in the actual xpfAggregateToString() operation. |
Options
 | Option | Comment |
---|---|---|
1 | xpxSKIP_UNSET_VALUE | Instances with the actual attribute value unset will be skipped (default behavior) |
2 | xpxERROR_ON_UNSET_VALUE | The xpfDefineLongString() or xpxAddToLongString() functions will fail with an error condition when the actual instance's attribute value is unset. |
3 | xpxINSTANCEID_FOR_UNSET_VALUE | The actual instanceId (transferred to a string) will be used as the string when the actual instance's attribute value is unset. |
4 | xpxDELIMITER_FOR_UNSET_VALUE | The defined "stringDelimiter" value will be used as the string when the actual instance's attribute value is unset. |
5 | xpxSKIP_PREFIX_FOR_UNSET_VALUE | The defined "stringPrefix" will be skipped for unset attribute values |
6 | xpxSKIP_SUFFIX_FOR_UNSET_VALUE | The defined "stringSuffix" will be skipped for unset attribute values   |
Â
Example
<Missing Example>
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â