Like this
set @howmanynumbers,20;//This the range of making a random number
setarray @numbers[0],rand(0,@howmanynumbers);
set @i,1; //This is just a counter
while(@i<@howmanynumbers)
{
set @hasmatch,0;//Indicator if the number has not matched
setarray @numbers[@i],rand(0,@howmanynumbers);
for(set @j,0;@j<getarraysize(@numbers);set @j,@j+1)
{
if(@numbers[@i]==@numbers[@j])
{
set @j,getarraysize(@numbers); //So the loop will end
set @hasmatch,1; //It found a match so set the @hasmatch to 1
}
}
//If no matched found go to the next array index else dont increment the counter
if(@hasmatch==0)
set @i,@i+1;
}