Code Block | ||||
---|---|---|---|---|
| ||||
FUNCTION xpfSplitStringToAggregate(str : STRING; options : INTEGER; stringDelimiter : STRING; stringPrefix : STRING; stringSuffix : STRING; listId : LIST OF GENERIC; elementIndex : INTEGER) resultListId : LIST OF GENERIC; |
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 Function that splits a string into an aggregate of strings. This function has variable number of arguments, i.e., it may can be invoked with 1 to 10 number of minimum 1 argument and maximum 7 arguments.
Arguments
...
1 | Type | Name | Comment | ||||
2 | GENERICSTRING | 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 instancesstr | The actual string that will be split into aggregate elements. | |||
3 | INTEGER | options | Optional argument. Default value is INDETERMINATE (?). All the available options are only valid when the actual value is an instance attribute valueoptions = 0. | ||||
4 | GENERICSTRING | attributeIdOrAttributeNamestringDelimiter | Optional argument. Default value is INDETERMINATE ' ' (?white space). Specifies an attribute of the instances that constituteds the elements that are used to construct the result string. 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 attributeIdthe delimiter between each substring in the actual "str" string. The string delimiter will be removed in the string splitting operation. | ||||
5 | STRING | stringDelimiterstringPrefix | Optional argument. Default value is " " INDETERMINATE (white space?). Defines the delimiter string that is appended after each string that constitutes the result string. When no delimiter is wanted, an empty string ('') must be specified,Specifies the prefix of each substring. This prefix will be removed in the string splitting operation. | ||||
6 | STRING | defaultStringForUnsetValuestringSuffix | Optional argument. Default value is INDETERMINATE (?). Defines the string that Specifies the suffix of each substring. This suffix will be removed in the actual string value when the actual instance's attribute value is unsetstring splitting operation. | ||||
7 | STRING | integerAndInstancePrintFormatLIST OF GENERIC | listId | Optional argument. The defult value is "%lu". Defines the "format specification" used in the "printf" operation when the actual element is an INSTANCE or an INTEGER.Default value is INDETERMINATE (?) | |||
8 | INTEGER | elementIndex | Optional argument. Default value is 1 meaning first element in the specified aggregateINDETERMINATE (?). Specifies the first element index in the actual aggregate that is used to construct the result string.This argument has no effect when the "aggrIdOrInstanceHashTableIndex" argument specifies an EDMinstanceHashTable. | 9 | INTEGER | elements | Optional argument. Default value is INDETERMINATE (?) meaning "include last element" in the specified aggregate specifies the last element in the actual aggregate that is used to construct the result stringresulting "listId" aggregate that will be populated with the first element from the string splitting operation. The default is that the first element will be appended to the existing aggregate "listId". This argument has no effect when the the argument "aggrIdOrInstanceHashTableIndex" argument specifies an EDMinstanceHashTable. |
10 | STRING | stringPrefix | Optional argument. Default value is INDETERMINATE (?). This argument defines the prefix that will be pretended to all strings that constitutes the result string | ||||
11 | STRING | stringSuffix | Optional argument. Default value is INDETERMINATE (?) This argument defines the suffix string that will be appended to all strings that constitutes the result stringlistId" is not specified. |
Return Value
...
Type | Name | Comment |
STRINGLIST OF GENERIC | resultStringresultListId | The constructed (concatenated) string resulting aggregate of strings will be return returned when the function is successfully performed. When the function fails,a new aggregate is created as the result aggregate, this will be a LIST aggregate. The value INDETERMINATE (?) will be returned when the function fails. Exception handling should be used to handle error conditions in the actual xpfAggregateToStringxpfSplitStringToAggregate() operation. |
Options
...
Option | Comment | ||
---|---|---|---|
1 | xpxSKIPXPXINTEGER_UNSET_VALUE | Instances with the actual attribute value unset will be skipped | |
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 | AGGR | The substring of "str" will be transferred into an integer element, i.e., the resulting aggregate will be an aggregate of INTEGER. It is assumed that each substring is a string of digits. |
2 | XPXINSTANCE_AGGR | The substring of "str" will be transferred into an instance element, i.e., the resulting aggregate will be an aggregate of GENERIC (instanceIds). It is assumed that each substring is a string of digits. | |
3 | XPXAPPEND_STRINGS | Append the elements from the split string into the aggregate specified in the "listId" argument. Hence, this option is only effective when the argument "listId" is specified. | |
4 | XPXPREPEND_STRINGS | Prepend the elements from the split string into the aggregate specified in the "listId" argument.Hence, this option is only effective when the argument "listId" is specified. | |
5 | XPXSCRATCH_AGGR | The new created resultListId will be a scratch aggregate instead of a volatile aggregate. |
Example
...
Code Block | ||
---|---|---|
| ||
<Missing Example> |
...