while true do begin Cmd:=GetClickedCommand; if Cmd = CmdExit then halt; if Cmd = RestartCmd then Restart; Delay(100); end;