Writing a String with v_st()

The video string function, v_st(), is the basic string output function of Vermont Views. The format of the call is:

UCHAR *v_st(stp, wnp)
 
UCHAR *stp;
/* String to be written
*/
WINDOWPTR wnp;
/* Pointer to window to write in
*/

v_st() writes output beginning at the location of the virtual cursor. Output stays within the window buffer. The window attribute is used to write the string. (You can change the window attribute with the function sw_att() See Chapter 25, "Changing the Appearance of Windows" for more information.) v_st() respects all option settings for the windows.

For v_st() and other string output functions, a NULLP is returned if the end of the string is reached. (The default is for the entire string to be written.) If the full string was not written, a pointer to the next character in the string is returned. If you want to finish writing the string, you can use this pointer as the next string to write to the window. For example:

next_stp = v_st(long_stp, wnp);
/* Write a string to a window,
*/
 
/* saving pointer string 
*/
ki();
/* Wait for keystroke



*/
if (next_stp != NULLP)
/* If entire string was not written
*/
{
   
    wn_clr(wnp);
/* Clear window
*/
    cs_mv(0, 0, wnp);
/* Move virtual cursor to (0, 0)
*/
    v_st(next_stp, wnp);
/* Write rest of string
*/
}
   


Home Contents Previous Next