und hier ne function
Code:
function Random(rFrom, rTo: Integer; const rWithOut: Array of Integer ): Integer; overload;
var
i: Integer;
nFlag: Boolean;
begin
repeat
nFLag := True;
Result := system.Random( rTo - rFrom + 1 ) + rFrom;
for i:= low(rWithOut) to high(rWithOut) do
if Result = integer(rWithOut[i]) then
begin
nFlag := False;
break;
end;
until nFlag;
end;
// evt. Auruf:
random( 3, 5, [1,2,3,4] ) );
Wäre vlt. was für die Code-Library ? hehe