As of C2 Release 87 there are two features that make this easy: While loop and a feature to test if a value is in the array. The "Tries" number shows the number of times a random number was generated. If it is bigger than the array width, then there were duplicates among the numbers generated, and so new random numbers were generated. Click the Refresh button a number of times to see the variation in the number of tries it takes to fill the array with unique numbers.
RandomArrayNoDuplicates.capx