OpenSTA logo OpenSTA SCL Reference
CONVERT Command

CONVERT Command

This command allows the value in an integer variable to be converted to a string, or vice versa. The default radix for the conversion is 10, but this may be overridden by including a RADIX clause in the command.

For integer-to-character conversions, format options may be specified. These options can cause the string to be left or right justified within the output buffer, or to have leading zeros or spaces, or cause the conversion to be signed or unsigned.

The default options are SIGNED and LEFT JUSTIFY. If RIGHT JUSTIFY is in operation, the default filling is LEADING ZEROS.

If the output buffer is too small to hold the output string, it will be filled with asterisk (*) characters.

For character-to-integer conversions, leading and trailing spaces are removed form the ASCII string before the conversion. Specification of a non-numeric string, or of a string which is converted to a numeric outside the range of an integer value, will cause a message to be logged to the audit file indicating an invalid character string to convert. The thread will be aborted.

The ON ERROR GOTO err-label clause can be specified to define a label to which control should be transferred in the event of an error.

Command Definition:

CONVERT variable1 TO variable2
	{,[SIGNED|UNSIGNED]} {,LEADING [ZEROS|SPACES]}
	{,[LEFT|RIGHT] JUSTIFY} {,RADIX=radix}
	{,ON ERROR GOTO err-label}

variable1

A variable containing the value to be converted.

variable2

A variable into which the converted variable1 is to be placed.

radix

An integer variable or value in the range 2 to 36.

err-label

A label defined within the current scope of the Script to which control branches if an error occurs.

Examples:

CONVERT Number To String
CONVERT Number To Employee-Code, RIGHT JUSTIFY
CONVERT Ascii-Code To Numeric-Code
CONVERT Ascii-Code To Hex-Code, RADIX=16, &
	 ON ERROR GOTO CONV_ERROR

Note: This command is known to have multiple issues - see bug# 460324 for current status.


<<<
prev page
^^^
section start
>>>
next page