unit modulmenu; interface uses crt,slova; procedure Menu(s1, s2, t: string; var l: byte; var h: char); implementation var i, j, l: byte; h: char; s1, s2, t: string; f1: text; procedure Menu(s1, s2, t: string; var l: byte; var h: char); begin ClrScr; {ochistka ekrana} GotoXY(32, 3); Writeln(t); GotoXY(38, 18); Writeln('Для выхода из программы нажмите Esc'); GotoXY(38, 20); Writeln('Для перемещения курсора нажимайте'); GotoXY(38, 22); Writeln('стрелки вверх и вниз'); TextBackGround(14); Window(25, 7, 55, 8); ClrScr; Writeln(s1); TextBackGround(3); Window(25, 5, 55, 6); ClrScr; Writeln(s2); l := 1;{tekushee polozhenie kursora i podsvetki} h := readkey; while not ((h = #27) or (h = #13)) do {poka ne nazhato Esc ili Enter} begin h := ReadKey; j := l;{otvechaet za staroe polozheie kursora i podsvetki} if Ord(h) = 0 then h := ReadKey; if Ord(h) = 80 then Inc(l);{esli nazhata klavisha upravleniya kursorom vniz} if Ord(h) = 72 then Dec(l);{esli nazhata klavisha upravleniya kursorom vverh} if l = 0 then l := 2;{dlya perehoda po punktam menu} if l = 3 then l := 1; {peremeshenie kursora na novoe mesto} TextBackGround(14); case j of 1: Window(25, 5, 55, 6); 2: Window(25, 7, 55, 8); end; ClrScr; if j = 1 then writeln(s2) else writeln(s1); TextBackGround(3); case l of 1: Window(25, 5, 55, 6); 2: Window(25, 7, 55, 8); end; ClrScr; if l = 1 then writeln(s2) else writeln(s1); {zatiranie starogo kursora} end; if (h = #27) then halt; TextBackGround(0); Window(1, 1, 80, 25); ClrScr; Delay(300); end; end.