diff --git a/PRAKTIKA.PAS b/PRAKTIKA.PAS index ceeffc5..981d7d2 100644 --- a/PRAKTIKA.PAS +++ b/PRAKTIKA.PAS @@ -3,7 +3,7 @@ program pr; var tmp_d, tmp_m : integer; {screen variables} p,p1 : char; {readkey} y_wlcm : integer; {Vsplivayushii text} - i : integer; {Vspomogatelnie peremennye} + i,e : integer; {Vspomogatelnie peremennye} cur : integer; {Posicia kursora v menu} x,y, th : integer; {Peremennye dlya vyvoda teksta} ch, cf, ct : integer; {Peremennye dlya chtenia teksta} @@ -16,7 +16,7 @@ program pr; lectstatus,path,j: string; mainmenu : array [1..22] of string; {menu} lines : array [1..30] of string; {readtext} - test : array [1..4] of string; {readtest} + test : array [1..5] of string; {readtest} {Procedura inicializacii grafiki} procedure init_screen; @@ -34,6 +34,7 @@ program pr; procedure menu ; forward; procedure lections(var lect:integer); forward; procedure ui(ttitle, tbar : string; back : integer); forward; + procedure question(var tst:integer); forward; {Procedura inicializacii peremennyh} procedure init_variables; @@ -50,7 +51,7 @@ program pr; javame := 'JavaME'; lectstatus := 'F1 - Помощь T - Тест ESC - Меню'; menustatus := 'ESC - Выход UP,DOWN,LEFT,RIGHT - Передвижение курсора ENTER - Переход'; - path := {'Y:\SCHOOL.PAK\2PO-07\'} 'D:\TP\BIN\annimon\'; + path := {'Y:\SCHOOL.PAK\2PO-07\'}'C:\BP\BIN\annimon\' {'D:\TP\BIN\annimon\'}; {Menu Lekcii} for i:= 1 to 10 do begin @@ -162,7 +163,7 @@ program pr; for i:= numl to 30 do lines[i] := ''; end; end; - + {Chtenie voprosov iz faila} procedure readtlines; var numl : integer; @@ -225,10 +226,10 @@ program pr; outtextxy(x,20+i*ch,lines[i]); p1:=readkey; until (p1=#27) or (p1=#116) or (p1=#59); - if(p1=#116) then question(lect); {T - Test} + if(p1=#116) then question(lect) {T - Test} else if(p1=#59) then help_screen; {F1 - Help} end; - + {Procedura testirovania} procedure question(var tst:integer); begin @@ -246,17 +247,17 @@ program pr; repeat {Obrabotka klavish upravlenia} if p1='b' then changebk {color background} - else if p1='n' then changetxt; {n - text color} - if(ord(p1)>48 and ord(p1)<52) then {1,2,3} + else if p1='n' then changetxt {n - text color} + else if (p1='1') or (p1='2') or (p1='3') then {1,2,3} begin - if(p1=test[5]) inc(otv); + if(p1=test[5]) then inc(otv); end; ui(tmp,lectstatus,cf); {Otrisovka teksta} setcolor(ct); settextstyle(2,0,5); - for j:=1 to 4 do - outtextxy(x,20+j*ch,test[j]); + for e:=1 to 4 do + outtextxy(x,20+e*ch,test[e]); p1:=readkey; until (p1=#27) or (p1='l') or (p1=#59); if(p1='l') then begin break; lections(tst); end; {L - Lecton}