potřeboval bych najít chybu ve zdrojáku. V programu jsem zatím vytvořil jen menu, kde si uživatel vybere nějakou položku. Když najede ukazatelem na určitou položku a stiskne enter, bude následovat určitá akce, ale to si dodělám později. Problém je v tom, že když už ten enter stiskne, nic se neděje. Už jsem to zkoumal celkem dlouho a opravdu si nevím rady.
Kód: Vybrat vše
program pujcovna;
uses crt;
var
key : char;
x, y : integer;
procedure nahoru; (*pohyb šipek v menu*)
begin
y:=y-1;
if y<1 then y:=1;
gotoxy(x,y);
end;
procedure dolu; (*pohyb šipek v menu*)
begin
y:=y+1;
if y<1 then y:=1;
gotoxy(x,y);
end;
begin
cursoroff;
key:=#1;
window(4,3,50,50);
x:=1;
y:=3;
repeat
gotoxy(1,1);
writeln('PROGRAM PUJCOVNA');
writeln;
writeln(' KONTAKTY');
writeln(' PUJCENI');
writeln(' PREVZETI');
writeln(' SKLADOVA EVIDENCE');
writeln(' KONEC PROGRAMU');
gotoxy(x,y);
write(#26);
gotoxy(x,y); (*tady je něco v píči, fakt nevim co :@ *)
readkey;
if keypressed then key := readkey;
case key of
#72: begin (*pohyb šipek v menu*)
x:=wherex;
y:=wherey;
write(' ');
gotoxy(x,y);
if y=3 then y:=8;
nahoru;
write(#26); (*pohyb šipek v menu*)
gotoxy(x,y);
key:=#0;
x:=wherex;
y:=wherey; (*pohyb šipek v menu*)
end;
#80: begin
x:=wherex; (*pohyb šipek v menu*)
y:=wherey;
write(' ');
gotoxy(x,y);
if y=7 then y:=2;
dolu;
write(#26); (*pohyb šipek v menu*)
gotoxy(x,y);
key:=#0;
x:=wherex;
y:=wherey; (*pohyb šipek v menu*)
end;
#27: key:=#1;
#13: begin
y:=wherey;
case y of
7: key:=#27;
6: begin (*sklady*)
clrscr;
write('sklady!');
end;
5: begin (*převzetí*)
clrscr;
write('prevzeti');
end;
4: begin (*půjčení*)
clrscr;
write('pujceni');
end;
3: begin (*kontakty*)
clrscr;
writeln('KONTAKTY - PROHLIZENI');
writeln('Pro vytvoreni noveho kontaktu stisknete N');
writeln;
end;
end; (*end od case*)
read;
end;
end; (*end od case pro pohyb šipek v menu*)
until key=#27;
end.