Writing a String Without Respecting the Window Write Options

In some cases, you may want to write strings and/or attributes to the window without respecting the window write options. You may want to do this if you know what the string is, where it will go in the window, and that it will fit in the window. This may save you some processing time.

To write strings without respecting the window write options, use the video string with attribute no options function, v_stattnop():

void v_stattnop(wn_row, wn_col, stp, att, q, 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 q;
/* Number of characters from string to write
*/
int mv_type;
/* Type of move:  ST, STATT, ATT
*/
WINDOWPTR wnp;
/* Pointer to window to write in
*/

The type of move is interpreted as in the call to v_stattpl():

ST Writes just the string to the window without changing the attributes in the window. 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.

Function v_stattnop() is used in the following example to quickly print out table headings in a window.

...

...

v_stattnop(1, 1, "Month", LMESSAGE, 5, STATT, wnp);

v_stattnop(1, 15, "Gross Sales", LMESSAGE, 11, STATT, wnp);

v_stattnop(1, 30, "Returns", LMESSAGE, 7, STATT, wnp);

v_stattnop(1, 45, "Net Sales", LMESSAGE, 9, STATT, wnp);

wn_up(wnp);

You could also use this function to quickly write in the data in each column also.


Home Contents Previous Next