program name; var ok,clicked,back:command; begin procedure menu1; procedure menu;forvard; procedure pm1; begin var l_id,i_id:integer; begin showform; l_id:=formaddstring('1podmenu'); ok:=createcommand ('nazad',cm_back,0); addcommand(ok); repeat delay(100) clicked:=getclickedcommand; until clicked=ok; clearform; menu; end; procedure pm2; var l_id,i_id:integer; begin showform; l_id:=formaddstring('vtoroj-podmenu'); ok:=createcommand('nazad',cm_back,0); addcommand(ok); repeat delay(100) clicked:=getclickedcommand; until clicked=ok; clearform; menu; end; procedure pm3; var l_id,i_id:integer; begin showform; l_id:=formaddstring('3-ii-punkt'); ok:=createcommand ('nazad',cm_back,0); addcommand(ok); repeat delay (100); clicked:=getclickedcommand; until clicked=ok; clearform; menu; end; procedure menu; var p:array[0..3] of integer begin showmenu ('kody',ch_implicit,0); p[0]:=menuappendstring('1-iy-podmenu'); p[1]:=menuappendstring('2-oj-podmenu'); p[2]:=menuappendstring('3-ix-podmenu'); p[3]:=Menuappendstring('Nazad'); ok:=createcommand('chitat',cm_ok,1); addcommand=ok; repeat delay (100); clicked:=getclickedcommand; until clicked=ok; if menugetselectedindex=p[0] then pm1; if menugetselectedindex=p[1] then pm2; if menugetselectedindex=p[2] then pm3; if menugetselectedindex=p[3] then menu1; menu; end; procedure menu1; var p:array[0..1] of integer; begin showform; showmenu ('menu',ch_implict); p[0]:=menuappendstring ('podmenu'); p[1]:=menuappendstring ('vihod'); ok:=createcommand ('vibor',cm_ok,0); addcommand(ok); repeat delay(100); clicked:=getclickedcommand; until clicked:=ok; if (menugetselectedindex=p[0]) then menu; if (menugetselectedindex=p[1]) then halt; menu1; end; begin menu1; end.