xpfPrintfValue
FUNCTION xpfPrintfValue(value : GENERIC; options : INTEGER; fileId : INTEGER; width : INTEGER; realPrecision : INTEGER; integerFormat : STRING; realFormat : STRING; stringFormat : STRING; instanceFormat : STRING; aggregateFormat : STRING; logicalFormat : STRING; booleanFormat : STRING; enumerationFormat : STRING) resultString : STRING;
Function to transform any data value to a string using a "printf" operation. The actual result string will be printed. on the specified open file "fileId" or on the "userOutputFile", or the resultString will be returned as the function value. This function has variable number of arguments, i.e., it can be invoked with a minimum of 1 argument and a maximum of 11 arguments.
Â
Arguments
1 | Type | Name | Comment |
2 | INTEGER | value | The actual value to be transformed to the "resultString". |
3 | INTEGER | options | Optional argument. Default value is "xpxRETURN_STRING ~| xpxDECIMAL_FORMAT ~| xpxUPPERCASE_STRINGS" |
4 | INTEGER | fileId | Optional argument. Default value is INDETERMINATE (?). Specifies an open fileId. When the option xpxPRINT_TO_FILE is defined, the actual "resultString" will be printed to this file. |
5 | INTEGER | width | Optional argument. Default value is INDETERMINATE (?). This argument specifies the minimum number of characters in the "resultString" |
6 | INTEGER | realPrecision | Optional argument. Default value is realPrecision = 8. Defines the real precision for real value. |
7 | STRING | integerFormat | Optional argument.Specifies the format to be used in "printing" an integer value. All options except xpxPRINT_TO_FILE, xpxPRINT_TO_STDOUT, xpxRETURN_STRING will be neglected. |
8 | STRING | realFormat | Optional argument. Specifies the format to be used in "printing" a real value. All options except xpxPRINT_TO_FILE, xpxPRINT_TO_STDOUT, xpxRETURN_STRING will be neglected. |
9 | STRING | stringFormat | Optional argument. Specifies the format to be used in "printing" a string value. All options except xpxPRINT_TO_FILE, xpxPRINT_TO_STDOUT, xpxRETURN_STRING will be neglected. |
10 | STRING | instanceFormat | Optional argument. Specifies the format to be used in "printing" a instance (instanceId) value. All options except xpxPRINT_TO_FILE, xpxPRINT_TO_STDOUT, xpxRETURN_STRING will be neglected. |
11 | STRING | aggregateFormat | Optional argument. Specifies the format to be used in "printing" a aggregate (aggregateId) value. All options except xpxPRINT_TO_FILE, xpxPRINT_TO_STDOUT, xpxRETURN_STRING will be neglected. |
12 | STRING | logicalFormat | Optional argument. Specifies the format to be used in "printing" a logical value. All options except xpxPRINT_TO_FILE, xpxPRINT_TO_STDOUT, xpxRETURN_STRING will be neglected. |
13 | STRING | booleanFormat | Optional argument. Specifies the format to be used in "printing" a Boolean value. All options except xpxPRINT_TO_FILE, xpxPRINT_TO_STDOUT, xpxRETURN_STRING will be neglected. |
14 | STRING | enumerationFormat | Optional argument. Specifies the format to be used in "printing" an enumeration value. All options except xpxPRINT_TO_FILE, xpxPRINT_TO_STDOUT, xpxRETURN_STRING will be neglected. |
Â
Return Value
Â
Type | Name | Comment |
STRING | resultString | Â When the option xpxRETURN_STRING is set and the function is successfully performed the "resultString" will be returned. In all other cases the value INDETERMINATE (?) will be returned. Exception handling should be used to handle error conditions in the actual xpfPrintfValue() operation. |
Options
1 | Option | Comment |
2 | xpxPRINT_TO_FILE | The "resultString" will be printed to the open file specified in the "fileId" argument. |
3 | xpxPRINT_TO_STDOUT | The "resultString" will be printed to the "standard output" (userOutputFile) |
4 | xpxRETURN_STRING | The "resultString" will be returned as the function value from the xpfPrintfValue() operation |
5 | xpxAPPEND_NEWLINE | A new line character will be appended at the end of the "resultString" |
6 | xpxPREPEND_NEWLINE | A new line character will be inserted as the first character in the "resultString" |
7 | xpxLEFT_ALIGN_STRING | The "resultString" will be left aligned. |
8 | xpxLOWERCASE_STRINGS | All strings that are not real "string value" will be in lower case |
9 | xpxUPPERCASE_STRINGS | All strings that are not real "string value" will be in upper case        |
10 | xpxDATA_TYPE_NAME | The actual data type name will be part of the "resultString". The data types are "instance", "integer", "string", etc. |
11 | xpxABSOLUTE_VALUE | An integer value will be processed by an "abs(value)" operation A real value will processed by an "fabs(value)" operation. |
12 | xpxPREFIX_VALUE_WITH_SIGN_CHAR | An integer value and a real value will always be preceded by a sign character, i.e., "+" or "-". |
13 | xpxINTEGER_AS_REAL | An integer value will be handled as a REAL value, i.e., converted to REAL |
14 | xpxINTEGER_IN_OCTAL_FORMAT | An integer value will be "printed" in octal format. |
15 | xpxINTEGER_IN_HEX_FORMAT | An integer value will be printed hex format. |
16 | xpxINTEGER_IN_BINARY_FORMAT | An integer value will be printed in binary format ("100110101") |
17 | xpxUNSIGNED_VALUE | An integer value will be printed as an unsigned value. |
18 | xpxINSTANCE_TYPE | The instance type name (entity name) will be printed before an instance value |
19 | xpxPREFIX_INSTANCE_WITH_POUND_SIGN | An instance value will be preceded by the pound sign ("#") |
20 | xpxALWAYS_DECIMAL_POINT | A real value will always include a decimal point (".") |
21 | xpxSIENTIFIC_REAL_FORMAT | A real value will be printed in scientific format. |
22 | xpxDECIMAL_FORMAT | A real value will be printed in decimal format. |
23 | xpxSDAI_BOOLEAN_AND_LOGICAL_CONSTANTS | A logical and Boolean value should use the SDAI constants, i.e., sdaiTRUE, sdaiUNKNOWN, sdaiFALSE instead of the default TRUE, UNKNOWN, FALSE |
24 | xpxUNTYPED_VALUE | A typed value will be printed without any "type information" |
25 | xpxTYPE_INFO_AS_STRING | The "type information" in a typed value will be printed as strings, i.e., the "defined_type" names will be printed. |
When any of the arguments after the "realPrecision" are specified only the following options are effective:
 xpxPRINT_TO_FILE, xpxPRINT_TO_STDOUT, xpxRETURN_STRING .
Any combination of the xpxPRINT_TO_FILE, xpxPRINT_TO_STDOUT, xpxRETURN_STRING can be set at the same time.
Â
Example
<Missing Example>
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â