STR

Synopsis

HELP:   String representation of an integer
TYPE:   OBJECT
SYNTAX: STR(CHRSET=NONE/SYSTEM/ASCII/UCS1/UTF8/EBCDIC/UCS2BE/UTF16BE/UCS2LE/UTF16LE/UCS4BE/UTF32BE/UCS4LE/UTF32LE/LOCAL,BASE=num/BIN/B02/OCT/B08/DEC/B10/HEX/B16,GROUPSEPARATOR/MARKER=num/NON/OFF/SYSTEM/PERIOD/COMMA/SPACE/APOSTROPHE,VALUE='str')

Description

Reads a string representation of an integer number. The result is an FL5-internal neutral integer representation which can be converted to any of the supported target integer representations by a corresponding write converter.

The string can be in decimal (base 10), hexadecimal (base 16), binary (base 2) or octal (base 8) format. The BASE parameter must be set accordingly. The default base is decimal. Decimal numbers may be positive or negative. For all other bases, only positive numbers without a sign character are supported.

The CHRSET parameter must match the character set of the string. If no character set is specified, the system's default character set is assumed. All character sets supported by the character conversion module can be used, including multi-byte charsets.

If the string has some leading or trailing whitespace characters, they are ignored.

The VALUE parameter can be used to specify a default integer value in local character set and decimal base. An empty string will be replaced by the default value and will not result in an error anymore.

Arguments