FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
io_locate.c
Go to the documentation of this file.
1
/* console LOCATE statement */
2
3
#include "../fb.h"
4
#include "
fb_private_console.h
"
5
6
int
fb_ConsoleLocate
(
int
row,
int
col,
int
cursor )
7
{
8
int
x, y;
9
static
int
visible = 0x10000;
10
11
if
(!
__fb_con
.inited)
12
return
0;
13
14
if
((row <= 0) || (col <= 0))
15
fb_ConsoleGetXY
(&x, &y);
16
17
BG_LOCK
();
18
19
if
(col > 0)
20
x = col;
21
if
(row > 0)
22
y = row;
23
24
fb_hRecheckConsoleSize
( );
25
26
if
(x <=
__fb_con
.
w
)
27
__fb_con
.cur_x = x;
28
else
29
__fb_con
.cur_x =
__fb_con
.
w
;
30
if
(y <=
__fb_con
.
h
)
31
__fb_con
.cur_y = y;
32
else
33
__fb_con
.cur_y =
__fb_con
.
h
;
34
fb_hTermOut
(
SEQ_LOCATE
, x-1, y-1);
35
if
(cursor == 0) {
36
fb_hTermOut
(
SEQ_HIDE_CURSOR
, 0, 0);
37
visible = 0;
38
}
39
else
if
(cursor == 1) {
40
fb_hTermOut
(
SEQ_SHOW_CURSOR
, 0, 0);
41
visible = 0x10000;
42
}
43
44
BG_UNLOCK
();
45
46
return
(x & 0xFF) | ((y & 0xFF) << 8) | visible;
47
}
rtlib
unix
io_locate.c
Generated on Thu Jan 23 2014 19:40:09 for FreeBASIC by
1.8.4