home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
printer
/
sider.arc
/
DATA_IN.LIB
< prev
next >
Wrap
Text File
|
1988-01-06
|
2KB
|
62 lines
{***********************************************************************}
var key,
s_code,
location : integer;
{***********************************************************************}
procedure key_in; {similar to Basic's INKEY$ }
begin
with r do
begin
r.ax := $0000;
intr($16,r);
key := r.ax and $ff; {key code and }
s_code := r.ax shr 8; {scan code of key pressed}
end;
end;
{***********************************************************************}
procedure scrn_attr(col,row,attribute: byte; long :integer);
var where : integer; {Mono screen attributes}
begin { 0 = invisible }
for i := 0 to long-1 do { 1 = underlined }
begin { 7 = normal }
where := (col+i-1)*2+1 + (row-1)*160; { 112 = reverse video }
mem[scrn_seg:where] := attribute;
end;
end;
{***********************************************************************}
function query(num,col,row,choice,long,lns: integer): integer;
begin
scrn_attr(col,row+(choice*lns)-lns,112,long);
repeat
repeat key_in;
until s_code in [28,72,80];
scrn_attr(col, row+(choice*lns)-lns,7,long);
if (s_code = 72) then choice := choice-1 else
if (s_code = 80) then choice := choice+1;
choice := 1 +(choice +num -1) mod num;
scrn_attr(col, row+(choice*lns)-lns,112,long);
until key = 13;
query := choice;
end;
{**********************************************************************}
function menu123(num,col,row,choice,long:integer): integer;
var col_num : array [1..5] of integer;
begin
col_num[1] := 19;
col_num[2] := 29;
col_num[3] := 40;
col_num[4] := 48;
col_num[5] := 58;
scrn_attr(col_num[choice],row,112,long);
repeat
repeat key_in
until s_code in [28,75,77];
scrn_attr(col_num[choice],row,7,long);
if (s_code = 77) then choice := choice +1 else
if (s_code = 75) then choice := choice -1;
choice := 1 +(choice +num -1) mod num;
scrn_attr(col_num[choice],row,112,long);
until key =13;
menu123 := choice;
end;