FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
io_view.c
Go to the documentation of this file.
1
/* view print (console, no gfx) */
2
3
#include "
fb.h
"
4
5
/*:::::*/
6
int
fb_ConsoleViewEx
(
int
toprow,
int
botrow,
int
set_cursor )
7
{
8
int
do_update =
FALSE
;
9
int
maxrow, minrow;
10
11
12
minrow = 1;
13
fb_GetSize
(
NULL
, &maxrow );
14
if
( maxrow==0 )
15
maxrow =
FB_SCRN_DEFAULT_HEIGHT
;
16
17
if
( toprow > 0 ) {
18
do_update =
TRUE
;
19
}
else
if
( toprow == 0 ) {
20
do_update =
TRUE
;
21
toprow = minrow;
22
}
else
{
23
toprow =
fb_ConsoleGetTopRow
() + 1;
24
}
25
26
if
( botrow > 0 ) {
27
do_update =
TRUE
;
28
}
else
if
( botrow == 0 ) {
29
do_update =
TRUE
;
30
botrow = maxrow;
31
}
else
{
32
botrow =
fb_ConsoleGetBotRow
() + 1;
33
}
34
35
if
( toprow > botrow
36
|| toprow < 1
37
|| botrow < 1
38
|| toprow > maxrow
39
|| botrow > maxrow )
40
{
41
/* This is an error ... */
42
do_update =
FALSE
;
43
botrow = toprow = 0;
44
}
45
46
if
( do_update ) {
47
fb_ConsoleSetTopBotRows
( toprow - 1, botrow - 1 );
48
fb_ViewUpdate
( );
49
if
( set_cursor ) {
50
/* set cursor to top row */
51
fb_Locate
( toprow, 1, -1, 0, 0 );
52
}
53
}
54
55
return
toprow + (botrow << 16);
56
}
57
58
/*:::::*/
59
FBCALL
int
fb_ConsoleView
(
int
toprow,
int
botrow )
60
{
61
return
fb_ConsoleViewEx
( toprow, botrow,
TRUE
);
62
}
63
rtlib
io_view.c
Generated on Thu Jan 23 2014 19:40:12 for FreeBASIC by
1.8.4