Program S1; Uses Crt; Const {kodi klavish} CR=13; UPKEY=72; DOWNKEY=80; LEFTKEY=75; RIGHTKEY=77; ESC=27; {konstanti zvetov} CUR_TEXT=YELLOW; CUR_GROUND=CYAN; TEXT=WHITE; GROUND=BLUE; {punkyi menu} POINT : array [1..8] of string= ('MENU', '1.Enter the File', '2.Print the File', '3.Search', '4.Correct', '5.Delete', '6.Quit', 'Sdelaite vibor'); Function Getkey :integer; VAR S : integer; begin S:=ORD(Readkey); if S=0 then S:=ORD(Readkey); end; Procedure Cursor (y, txt, ground:byte); VAR S: string; i: byte; Begin gotoxy (1,y); textcolor (txt); textbackground (ground); S:=POINT [y]; for i:=langth (POINT [y]) to 20 do S:=S+i; Write (S); end; Procedure menu (y:byte); VAR i:byte; begin Window (1,1,80,25); textbackground (BLACK); clrcsr; Window (30,10,50,16); textbackground (GROUND); clrscr; textcolor (text); for i:=0 to 8 do Writeln (POINTS [i]); Window (30,11,50,15); Cursor (y, CUR_TEXT, CUR_GROUND); end; Function up (y:byte); Begin if y>1 then up:=y-1 else up:=4 end; Function down (y:byte); Begin if y<4 then up:=y+1 else down:=1 end; Procedure call (y : byte); Begin Window (1,1,80,25); textbackground (BLACK); clrscr; textcolor (WHITE); gotoxy (20,15); case of y 1: Writeln ('Form SUBD'); 2: Writeln ('Search'); 3: Writeln ('Vyvod'); 4: Writeln ('Correct'); 5: halt; 6: halt; 7: halt; 8: halt; end; delay (7000); end; VAR sym:integer; y:byte; BEGIN y:=1; menu(y); Repeat sym:=getkey; case sym of CR : begin call (y); menu (y); end; UPKEY: begin Cursor (y, text, ground); y:=UP(y); DOWNKEY begin Cursor (y, text, ground); y:=DOWN(y); Cursor (y, CUR_TEXT, CUR_GROUND); ESC: end; case Until sym=ESC; END.