Writing a String at a Specified Location With or Without an Attribute

Another function is provided to write a string at a specified place in the window. This function is a generic string output function that can be used to write a string to any part of the window, with or without a new attribute. The video place string with attribute function, v_stattpl() is as follows:

UCHAR *v_stattpl(wn_row, wn_col, stp, att, mv_type, wnp)
 
int wn_row;
/* Row of window to start writing at
*/
int wn_col;
/* Column of window to start writing at
*/
UCHAR *stp;
/* String to write
*/
UCHAR att;
/* Attribute to write string with
*/
int mv_type;
/* Type of move:  ST, STATT, ATT
*/
WINDOWPTR wnp;
/* Pointer to window to write in
*/

The move types are interpreted as follows:

ST Writes the string to the window without changing any of the attributes in the locations that the string fills. The specified attribute is ignored.
STATT Writes the string using the specified attribute. If you want to use the window attribute, specify the name of the window attribute explicitly or use wnp->att.
ATT Writes just the attribute to the window. The specified string is ignored.

For example, to write a string at a specified place in the window, using a new attribute, call the following:

v_stattpl(3, 0, "Hello, world!", LMESSAGE, STATT, wnp);

To write a string in the window, retaining the attributes at the spaces being written to, call the following:

v_stattpl(3, 0, "Hello, world!", 0, ST, wnp);

v_stattpl() behaves like v_stpl(), returning a NULLP if the string was completely written and a pointer to the next character in the string if it was not.


Home Contents Previous Next