Print using a C-like format.
printf(“format string”, var1[, var2 …])
Parameters inside the [brackets] are optional.
printf will print a formatted version of the values its arguments to the screen using a syntax similar to the C “printf” command. The printf formatting can truncate floating point numbers to integers in the output. printf returns 0 to the Minc environment.
printf will ignore the value set for printing using the set_option, print_on or print_off commands and always print its arguments.
“format string”
The C-syntax format string (i.e., “%d, %f, %3.2f, %s, \n” .. etc.) used to format the output that will appear on the screen.
var1, var2…
The variables to be printed, corresponding to the format string.
The following scorefile:
a = 7.8
printf("the value of a is: %f, %s\n", a, "so THERE!")
will produce the following output:
the value of a is: 7.8, so THERE!