Writing Strings to Windows

There are a number of video string functions to write strings to a window. Different functions allow you to have different levels of control over the way strings are written. For example, the simplest function, v_st(), writes a given string to a window at the location of the virtual cursor, using the window's attribute. v_stattpl(), on the other hand, allows you to specify the location to write the string and the attribute used to display it.

Most Vermont Views string output functions respect the current state of the window options. The exceptions are v_stattnop() and v_printf(). All string output functions handle tabs ('\t') and newline ('\n') characters.

Table 24.3: String Output Functions

Function Respects Options? Description
v_st(stp, wnp) Yes Writes a string using the window attribute
v_statt(stp, att, wnp) Yes Writes a string using a new attribute
v_stpl(r, c, stp, wnp) Yes Writes a string using the window attribute at a specified place in the window
v_stattpl(r, c, stp, att, mv_type, wnp) Yes Writes a string and/or attribute starting at a specified place
v_stattnop(r, c, stp, att, mv_type, wnp) No Writes the string and/or attribute to the window at a specified place
v_printf(wnp, format_stp, args...) Yes1 Formats output and writes it to the window.

1 Except for the scrolling quantity. The scrolling quantity is temporarily set to AS_NEEDED when doing formatted output.

Naming Tip: All functions that write to windows are preceded by "v_", for video.

More:

Writing a String with v_st()

Writing a String Using a New Attribute

Writing a String at a Specified Location

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

Centering and Justifying Output in a Window

Writing Formatted Strings

Writing a String Without Respecting the Window Write Options


Home Contents Previous Next