PRINT - do a PRINTF into a string.

Alternate Entry Name: .PRINT

Usage:

B:
   ret = print( string, format, arg1, arg2, ..., argn );
/* C users use "sprintf" */

Where:

string
points to the string to which output should be directed.
format, arg1, arg2, ..., argn
are a PRINTF-style format string and arguments.
ret
is an integer giving the number of characters written to the string.

Description:

PRINT writes "arg1" through "argn" out (in ASCII) into the vector "string" using the "format" given. The string "format" may be in any form acceptable to PRINTF.

Examples:

auto v[20], a, b, s;
s = "are the result";
a = 5;
b = 0777;
print(v, "%d and %o %ss.*n", a, b, s);

will leave

"5 and 777 are the results.*n"

in "v".

Notes:

In previous releases of the UW Tools package, PRINT returned a pointer to "string". It now returns the result returned by the PRINTF function.

See Also:

expl b lib printf

Copyright © 1996, Thinkage Ltd.