CCS Standardfunction   PrintInt [Str]
 

PrintInt [Str]

Value [INT]

Characters [INT]

Leading_Zeros [Str]

Format [Str]

Description of Function

Represents an integer value as a formatted string.

In the case of decimal format, the minus sign is always shown but the plus sign only if the relevant presentation format is selected. In the case of binary, octal and hexadecimal formats, negative values are converted according to the following formula:

- abs(int)

base = 2, 8 or 16 for BIN, OCT or HEX format
int is the negative integer value to be represented

Testing Points

None

Parameters

Value

Value (or variable containing the integer value) to be represented as a formatted string.

Characters

The number of characters to be used to represent the value as a string. If no leading zeros are to be shown, only as many characters as necessary are used. The parameter Characters is then interpreted as the maximum permissible number of characters; if the specified number is insufficient, an error message is returned.

Leading_Zeros

Specifies whether leading zeros are to be shown or not.
J = Yes, show leading zeros
N = No, do not show leading zeros

Format

Format for representation of the integer value as a string.

HEX

Value in hexadecimal format

DEZ

Value in decimal format

VDEZ

Value in decimal format with mathematical sign (including '+').

BIN

Value in binary format

OCT

Value in octal format

ReverseHEX

HEX format with reversed byte order (Low byte first) (only even numbers of characters allowed).

Examples

Result

PrintInt

10,6,J,HEX

00000A

PrintInt

74565,6,J,HEX

012345

PrintInt

74565,6,J,ReverseHEX

452301

PrintInt

W1,8,J,BIN

00000101 if Variable W1= 5