
Command Reference
114089 Rev. A 2-41
sprintf
The sprintf command converts and formats text, and saves the result in a specified
variable for later use.
The
sprintf command uses the following syntax:
sprintf
<variable_name> <format> <p1> <p2> . . . <pN>
<variable_name>
is the name of the environment variable where the formatted
string is saved.
<format>
is the conversion specification. (See “printf” for information about
conversion specifications.)
<p2> . . . <pN>
is the list of arguments to be formatted.
If you enter the
sprintf command incorrectly, the console returns one of the
following error messages:
•
sprintf: Expected numeric argument; invalid string argument
found
The %
<conversion_specification>
expected numeric data in the input
argument, which contained a text string (“hello there”) instead of a number
(123).
•
sprintf: Format string has more format codes than there are
arguments
The <
format
> string has more conversion specifications than there are input
arguments (<
p1
>,. . .,<
pN
>).
•
sprintf: Invalid format code
You entered an invalid conversion specification in the format string (%z).
•
*ERROR*** Symbol name is greater than 15 characters
You specified a variable name longer than 15 characters.
•
*ERROR*** Invalid character “<invalid_character>” in <symbol>
You entered an invalid character in the variable name.
•
**ERROR*** Symbol text is greater than 255 characters
The value assigned to the variable is longer than 255 characters.
Comentários a estes Manuais