[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
VGETCHRSA Introduced: v3.12
. Summary
vgetchrsa(int <x>, int <y>, str <buf>, int <pos>, int <num>);
. Description
The vgetchrsa function is used to read multiple characters starting
from a spot on the screen into a specified variable. Vgetchrsa
saves both the characters and color attributes (a series of double
bytes). <x>,<y> is the spot on the screen to start reading characters.
<buf> is the string variable to put characters into, starting at an
offset of <pos> in the variable. Note that each character read in with
vgetchrsa will take up two bytes in the string variable, since the
color attribute is also saved. Note also that this function does not
put a 0 (NULL, or end of string character) at the end of the sequence
of characters it grabs. If the characters returned by vgetchrsa are to
be manipulated as a string a 0 must be added at the end with the setchr
function.
. Return Value
None.
. Example
// copy a 20 by 10 grid of characters with a left hand corner of
// 10,5 to 40,7, and keep color attributes
str buffer[400]; // 20 wide * 10 tall * 2 bytes per character
int y;
for (y = 5; y < 15; y = y+1) // read chars in a loop
vgetchrsa(10, y, buffer, 2 * 20 * (y - 5), 20);
for (y = 7; y < 17; y = y+1) // now write them in a loop
vputchrs(10, y, buffer, 2 * 20 * (y - 7), 20);
See Also:
vgetchr
color chart
ASCII table
vgetchrs
vputchrs
vputchrsa
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson