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


1TypeNameComment
2
INTEGER
value

The actual value to be transformed to the "resultString".

3
INTEGER
optionsOptional argument. Default value is "xpxRETURN_STRING ~| xpxDECIMAL_FORMAT ~| xpxUPPERCASE_STRINGS"
4
INTEGER
fileIdOptional 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
realPrecisionOptional argument. Default value is realPrecision = 8. Defines the real precision for real value.
7
STRING
integerFormatOptional 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
realFormatOptional 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
stringFormatOptional 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
aggregateFormatOptional 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
logicalFormatOptional 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
booleanFormatOptional 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
enumerationFormatOptional 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


 

TypeNameComment
STRINGresultString 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


1OptionComment
2xpxPRINT_TO_FILEThe "resultString" will be printed to the open file specified in the "fileId" argument.
3xpxPRINT_TO_STDOUTThe "resultString" will be printed to the "standard output" (userOutputFile)
4xpxRETURN_STRING

The "resultString" will be returned as the function value from the xpfPrintfValue() operation

5xpxAPPEND_NEWLINEA new line character will be appended at the end of the "resultString"
6xpxPREPEND_NEWLINEA new line character will be inserted as the first character in the "resultString"
7xpxLEFT_ALIGN_STRINGThe "resultString" will be left aligned.
8xpxLOWERCASE_STRINGSAll strings that are not real "string value" will be in lower case
9xpxUPPERCASE_STRINGS

All strings that are not real "string value" will be in upper case        

10xpxDATA_TYPE_NAMEThe actual data type name will be part of the "resultString". The data types are "instance", "integer", "string", etc.
11xpxABSOLUTE_VALUEAn integer value will be processed by an "abs(value)" operation A real value will processed by an "fabs(value)" operation.
12xpxPREFIX_VALUE_WITH_SIGN_CHARAn integer value and a real value will always be preceded by a sign character, i.e., "+" or "-".
13xpxINTEGER_AS_REALAn integer value will be handled as a REAL value, i.e., converted to REAL
14xpxINTEGER_IN_OCTAL_FORMATAn integer value will be "printed" in octal format.
15

xpxINTEGER_IN_HEX_FORMAT

An integer value will be printed hex format.
16xpxINTEGER_IN_BINARY_FORMATAn integer value will be printed in binary format ("100110101")
17xpxUNSIGNED_VALUEAn integer value will be printed as an unsigned value.
18xpxINSTANCE_TYPEThe instance type name (entity name) will be printed before an instance value
19xpxPREFIX_INSTANCE_WITH_POUND_SIGNAn instance value will be preceded by the pound sign ("#")
20xpxALWAYS_DECIMAL_POINTA real value will always include a decimal point (".")
21xpxSIENTIFIC_REAL_FORMATA real value will be printed in scientific format.
22xpxDECIMAL_FORMATA real value will be printed in decimal format.
23xpxSDAI_BOOLEAN_AND_LOGICAL_CONSTANTSA logical and Boolean value should use the SDAI constants, i.e., sdaiTRUE, sdaiUNKNOWN, sdaiFALSE instead of the default TRUE, UNKNOWN, FALSE
24xpxUNTYPED_VALUEA typed value will be printed without any "type information"
25xpxTYPE_INFO_AS_STRINGThe "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.

Â