Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

sprintf

sprintf( 
{s_Var | nil } 
t_formatString 
[ g_arg1 ... ] 
) 
=> t_string

Description

Formats the output and assigns the resultant string to the variable given as the first argument.

sprintf is a syntax form and should not be used as an argument to apply or eval.

If nil is specified as the first argument, no assignment is made, but the formatted string is returned.

Arguments

s_Var

Variable name.

nil

nil if no variable name.

t_formatString

Format string.

g_arg1

Arguments following the format string are printed according to their corresponding format specifications.

Value Returned

t_string

Formatted output string.

Examples

sprintf(s "Memorize %s number %d!" "transaction" 5)
=> "Memorize transaction number 5!"
s 
=> "Memorize transaction number 5!"
p = outfile(sprintf(nil "test%d.out" 10))
=> port:"test10.out"

Related Topics

String Functions

Common Output Format Specifications


Return to top
 ⠀
X