while true do begin Cmd:=GetClickedCommand; if Cmd = CmdExit then halt; if Cmd = ...// проверка других команд Delay(100); end;