In file output.h:

void prompt

(int num, ...)

Format and display a prompt.

Documentation

Format and display a prompt.

Ah, the building block of every module in the system. This function performs almost all of the output of your average module. It works in much the same was as printf(). Unlike the omnipresent C function, however, prompt() doesn't use a string format string, but a number. The number indices one of the prompts inside the currently active prompt block. These indices have symbolic names attached to them, that are also defined in C headers. A prompt block called test.mbk containing a prompt called HELLO would thus have an include file test.h with something like #define HELLO 4.

The prompt() function takes just this symbolic name for a prompt, where it obtains the format string. Most prompts have no format specifiers, and thus take no arguments, just like you can use printf() to print a string without formatting numbers et cetera inside it. Format specifiers within prompt blocks are exactly the same as those used by printf() and friends. The same rules about number and type of additional arguments hold here, too.

The format specifiers are substituted with formatted strings, numbers (and what have you) before anything else. Variable substitution, line wrapping, et cetera happen immediately afterwards.

This function is not without its limits. Expect horrific breakage if the prompt is longer than 8 kbytes. Actually, the breakages may occur somewhere between 8 and 16 kbytes. This is a reasonable limit: given an 80 by 25 text mode, 8 kbytes is around four completely full screens. If you need to print something this large, you're probably doing something wrong (try using the Menu Manager, which prints out the contents of entire files without size limitations).

Parameters:
num - The prompt number to use, followed by any arguments needed by the prompt in question.
See Also:
printf(), sprompt(), sprompt_other(), print(), sprint(), sprint_other().

Alphabetic index



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