Form1 edCompte : TEdit; edClient : TEdit; etc Form2 edCompte : TEdit; edClient : TEdit; etc
[Valeur] edCompte=Une valeur edClient=Une autre valeur etc
var i, j, k : Integer; tabInt : Array[1..32] of Integer; tabVal : Array[1..32] of String; Doublon : Boolean; begin Randomize; // Initialiser le générateur de nombre aléatoire for j := 1 to 32 do // Intialiser le tableau d'Index begin tabInt[j] := 0; end; j := 1; // 1er index while (j <= 32) do // Remplir le tableau avec 32 Index aléatoires begin // en évitant deux fois la même valeur (doublon) i := Random( 33); if i = 0 then Inc(i); // Interdir valeur 0 Doublon := False; for k := 1 to j-1 do // Recherche des doublons begin if tabInt[k] = i then Doublon := True; // Doublon détecté, on recommence end; if Not Doublon Then begin tabInt[j] := i; // Ok, pas de doublon Inc( j); end; end; j := 1; for i := 0 to MyForm.ComponentCount-1 do // On recherche tous les TEdit begin if MyForm.Components[i] is TEdit then begin (MyForm.Components[i] as TEdit).Text := tabVal[ TabInt[j]]; Inc(j); // Chercher TEdit suivant end; end; end;