Conversion specifications syntax – Visara Master Console Center Scripting Guide User Manual

Page 113

Advertising
background image

Chapter 5 Script Commands

Scripting Guide

113

Conversion Specifications Syntax

Each conversion specification in the String parameter has the following
syntax:

ƒ

% (percent sign). Processes the elements of the parameter list in
variable order. In such a case, the normal conversion character %
(percent sign) is replaced by %digit$, where digit is a decimal number
in the range from 1 to the total number of expr parameters.
Conversion is then applied to the specified parameter, rather than to
the next unused parameter.
When variable ordering is used:

-

It must be specified for all conversions.

-

The * (asterisk) specification for field width in precision is replaced by *digit$.

ƒ

Zero or more flags that modify the meaning of the conversion
specification. The flag characters and their meanings are as follows:
-

Left align within the field the result of the conversion.

+

Begin the result of a signed conversion with a sign (+ or -).
Overrides the (space) conversion specification.

(space)

Prefix a space character to the result if the first character of a

signed conversion is not a sign. If both the (space) and + flags
appear, the (space) flag is ignored.

#

Convert the value to an alternative form.

-

For o conversion, the function increases the precision to force the first digit of the
result to be a zero.

-

For x and X conversions, a non-zero result has 0x or 0X prefixed to it.

-

For c, d, and s conversions, the flag has no effect.

0

Pad to field width using leading zeros (following any indication
of sign or base) for o, x, and X, conversions (no space padding is
performed). If the 0 (zero) and—(dash) flags both appear, the 0
flag is ignored. For d, o, x, and X conversions, if a precision is
specified, the 0 flag is also ignored. For other conversions, the
behavior is undefined.

An optional decimal digit string that specifies the minimum
field width. If the converted value has fewer characters than
the field width, the field is padded on the left to the length
specified by the field width. If the left-adjustment flag is
specified, the field is padded on the right.

Advertising