[ Pobierz całość w formacie PDF ]

improve the standard output produced by C programs. Bear in mind
Page 813-24
Module 814 Input and Output in C
that because these functions are not standard they are not supported
outside the Turbo C environment. Further, because they do not directly
extend the functions provided by the standard library, they cannot be
used with programs that redirect standard input or output.
clreol
Syntax: void clreol(void)
Description: The clreol() function clears the screen from the current
cursor position to the end of the line in the active text
window. The cursor position remains unchanged.
clrscr
Syntax: void clrscr(void)
Description: The clrscr() function clears the entire active text
window and locates the cursor in the upper-left corner
(1,1). The colour of the window is set to the current
textbackground colour.
delline
Syntax: void delline(void)
Description: The delline() function deletes the line in the active
window that contains the cursor. All lines below the
deleted line are moved up to fill the gap and a blank
line is inserted at the bottom of the window. Only the
text inside the cureent window is affected.
gettext
Syntax: int gettext(int left, int top,
int right, int bottom,
void *buf)
Description: The gettext() function copies into the buffer pointed to
by buf the text from the rectangle defined by left,top
and right,bottom. The coordinates are screen
coordinates, not window relative. buf needs to point to
an amount of memory equal to 2 × rows×columns.
The function returns 1 if the action was successful, 0
on failure.
gotoxy
Syntax: void gotoxy(int x, int y)
Page 813-25
Module 814 Input and Output in C
Description: The gotoxy() function sends the text screen cursor to
the location specified by x,y. If either or both of the
coordinates are invalid, no action takes place.
insline
Syntax: void insline(void)
Description: The insline() function inserts a blank line at the current
cursor position, and all the lines below the cursor move
down. The function only affects the active text
window.
movetext
Syntax: int movetext(int left, int top,
int right, int bottom,
int newleft, int newtop)
Description: The movetext() function moves the portion of the
screen defined by the rectangle left,top and
right,bottom to the region of the screen that has its
upper-left corner defines by newleft,newtop. The
coordinates are screen coordinates, not window
relative. The function returns 1 if the action was
successful, 0 on failure.
puttext
Syntax: int putttext(int left, int top,
int right, int bottom,
void *buf)
Description: The gettext() function copies the text previously saved
in the buffer pointed to by buf to the region defined by
left,top and right,bottom. The coordinates are screen
coordinates, not window relative. The function returns
1 if the action was successful, 0 on failure.
textattr
Syntax: void clreol(int attr)
Description: The textattr() function sets both the foreground and
background colours in the text screen at one time. The
value of attr represents an encoded form of the colour
information. For example, to set the colours to be
white text on a green background, attr would be
defined as GREEN*16 | WHITE.
Page 813-26
Module 814 Input and Output in C
textbackground
Syntax: void clreol(int colour)
Description: The textbackground() function sets the background
colour of a text screen. A call to textbackground() only
affects subsequent write operations. The existing
background colour(s) remain unchanged. The valid
values for colour are shown below:
BLACK 0
BLUE 1
GREEN 2
CYAN 3
RED 4
MAGENTA 5
BROWN 6
LIGHTGRAY 7
textcolor
Syntax: void textcolor(int colour)
Description: The textcolor() function sets the colour of the text
displayed on the screen. The valid values for colour
are:
BLACK 0 DARKGRAY 8
BLUE 1 LIGHTBLUE 9
GREEN 2 LIGHTGREEN 10
CYAN 3 LIGHTCYAN 11
RED 4 LIGHTRED 12
MAGENTA 5 LIGHTMAGENTA 13
BROWN 6 YELLOW 14
LIGHTGRAY 7 WHITE 15
window
Syntax: void window(int left, int top,
int right, int bottom)
Description: The window() function is used to create a rectangular
text window whose upper-left and lower-right
coordinates are specified by left,top and right,bottom
respectively. If any coordinate is invalid, window()
takes no action.
No programming examples are provided in this section as the function [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • janekx82.keep.pl