In file output.h:

void sprint

(char* stg, char* buf, ...)

Format and store a string.

Documentation

Format and store a string.

This function resembles print(), but stores its results in a string instead of printing them. Its workings are not identical! There are subtle but important differences in semantics. Unlike print(), sprint():

Like print(), print() does expand substitution variables.

This function is useful for delayed evaluation of user prompts. Strings created with sprint() can be stored and later shown to the user with print(), which will take care of page breaks, ANSI and formatting directives. Substitution variables will be expanded at the time sprint() was called.

Alternatively, you can prepare a message using msg_getu() and sprint(). Then invoke usr_injoth() to send the string to another user. The string will be formatted locally for that user's terminal and preferences. Substitution variables will reflect the state of affairs of the user calling sprint().

Parameters:
stg - The string to store the formatted text in.
buf - A string with zero or more format specifiers, followed by zero or more additional arguments based on the number and type of format specifiers.
See Also:
printf(), print(), prompt(), sprompt().

Alphabetic index



This page was generated with the help of DOC++.