Как то так...Все в одной процедуре... 
	Код: 
	procedure TForm1.Button1Click(Sender: TObject);
type
 recc = record
  Q_num: integer; // номер строки
  A_num: integer;
 end;
var
 Test : array [0..9] of recc;
 qCount, q, ok, qa, q1 : word;
begin
 Randomize;//Достаточно запустить один раз
 qCount:= ListBox1.Items.Count;
 for q:=0 to qCount-1 do
 begin
  repeat
   ok:=0;
   qa:=Random(qCount);
   for q1:=0 to qCount-1 do
    if Test[q1].Q_num<>qa then
     ok := 1
    else
    begin
     ok := 0;
     break;
    end;
  until
   ok=1;
  Test[q].Q_num:=qa;
  ListBox2.Items.Add(IntToStr(Test[q].Q_num));
 end;
end; 
  
		
	
		
		
		
		
			
		
		
		
		
	
		
		
	
	
	 |