...select a random datarecord?

Author: Simon Grossenbacher
Homepage: http://www.swissdelphicenter.ch

Category: Database

procedure TForm1.FormCreate(Sender: TObject);
begin
  
Randomize;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  
Table1.First;
  Table1.MoveBy(Random(Table1.RecordCount));
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base