procedure TForm1.Button1Click(Sender: TObject); var x: Integer; begin Randomize; repeat x:= Random(20); until ((x<>3) and (x<>5) and (x<>10)); ShowMessage(IntToStr(x)); end;