home *** CD-ROM | disk | FTP | other *** search
- {************************************************************************}
- function video_pg: byte; {returns active video page}
- var page : byte absolute $0000:$0462; {required by w_col, and }
- begin {read1 functions}
- video_pg := page;
- end;
- {*************************************************************************}
- function w_col: integer; {cursor at which column}
- begin
- r.ah := $03;
- r.bh := video_pg;
- intr($10,r);
- w_col := r.dl +1;
- end;
- {*************************************************************************}
- function read1 : char; {read directly from the video display}
- begin
- r.ah := $08;
- r.bh := video_pg;
- intr($10,r);
- read1 := chr(r.al);
- end;
- {*************************************************************************}
- procedure input(ask :str24; col,row,long : integer);
- const bell = 7;
- back_space = 8;
- return = 13;
- escape = 27;
- lt_arrow = 75;
- rt_arrow = 77;
- var start,stop : integer;
- begin
- answer := '';
- gotoxy(col,row);write(ask);
- start := col + length(ask) +2;
- stop := start + long;
- textcolor(0);textbackground(15);
- for i := 0 to long -1 do
- begin
- gotoxy(start +i,row);write(' ');
- end;
- gotoxy(start,row);
- repeat key_in;
- if (w_col = stop) or (w_col > stop) then
- begin
- gotoxy(w_col ,row);
- textbackground(0);
- write(chr(bell));
- write(' ');
- textbackground(15);
- gotoxy(stop-1,row)
- end
- else
- begin
- write(upcase(chr(key)));
- if (key = escape) then exit;
- if (key = back_space) then
- begin
- write(' ');
- gotoxy(w_col -1,row);
- end;
- if (s_code = lt_arrow) then
- begin
- gotoxy(w_col -2,row);
- write(' ');
- gotoxy(w_col -1,row);
- end;
- if (w_col <start) then
- begin
- gotoxy(start-1,row);
- textbackground(0);write(' ');textbackground(15);
- gotoxy(start,row);
- end;
- end;
- until key = return;
- for i := 1 to long do
- begin
- gotoxy(start -1 +i,row);
- insert(read1,answer,i);
- end;
- normvideo;
- end;
- {*************************************************************************}