Отправляет email-рассылки с помощью сервиса Sendsay

Программирование. Форум !!!

Re: Pascal

program dima_k;
uses CRT, DOS;
const
attrSelected = $f;
attrPassive = $7;

const
max = 3;
Menu: array[1..max] of string =
('1. Выбор 1','2. Выбор 2','3. Выбор 3');

function SelectMenu(Waiting: Longint): Integer;
var
PCTime : Longint absolute $040:$06c;
selected: Integer;
time: Longint;
c: Char;
reg: registers;

procedure SetSelected(No: Integer);
begin
if No=Selected then Exit else
if No < 1 then No:=max else
if No > max then No:=1;
GotoXY(1, Selected); Write(Menu[Selected]);
Selected:=No;
TextAttr:=attrSelected;
GotoXY(1, Selected); Write(Menu[Selected]);
TextAttr:=attrPassive;
end;

begin
reg.ah:=01;
reg.ch:=$20;
intr($10, reg); {Спрячем курсор}
textAttr:=attrPassive;
for selected:=1 to max do
writeLn(menu[selected]);

Selected:=0;
SetSelected(1);

time:=PCTime + 55;

repeat
if time <= PCTime then begin dec(Waiting); time:=PCTime+55 end;
if keypressed then
begin
c:=ReadKey;
case c of
'1'..'3': begin SetSelected(ord(c)-48); c:=#13 end;
#0: begin
c:=ReadKey;
case c of
'H': SetSelected(selected-1);
'P': SetSelected(selected+1);
end;
end;
end;

end;
gotoXY(1, max+1); Write(
'Выберите пункт меню. ',(time - PCTime) div 55+1);
until (c = #13) or (Waiting <= 0);
SelectMenu:=Selected;
reg.ah:=1; reg.cl:=12; reg.ch:=11; intr($10, reg);
end;

var
iMenu: Integer;
BEGIN
ClrScr;
iMenu:=SelectMenu(5);

GotoXY(1, max+ 3); WriteLn('==================');
Write(iMenu);
END.

Исходное сообщение От: "keel" <dima***@s*****.by>
Кому: "comp.soft.prog.prog (2266597)" <surin_***@m*****.ru>
Отправлено: 3 января 2004 г. 9:59
Тема: Pascal

Получить правила : mailto:comp.soft.prog.prog-rules@subscribe.ru
Формат "дайджест" : mailto:comp.soft.prog.prog-digest@subscribe.ru
Формат "каждое письмо" : mailto:comp.soft.prog.prog-normal@subscribe.ru
Формат "читать с веба" : mailto:comp.soft.prog.prog-webonly@subscribe.ru

-*Информационный канал Subscribe.Ru
Написать в лист: mailto:comp.soft.prog.prog-list@subscribe.ru
Отписаться: mailto:comp.soft.prog.prog--unsub@subscribe.ru

http://subscribe.ru/ mailto:ask@subscribe.ru

Ответить   Sat, 3 Jan 2004 14:22:30 +0300 (#45687)