You can use a random shuffle:
#constant CARDS_NEEDED 10
dim Deck(52)
` Initialise the deck
for i = 1 to 52
Deck(i) = i
next
` Fisher–Yates shuffle
Size = 52
for i = 1 to CARDS_NEEDED
swap array items Deck(), i, i + rnd(Size - 1)
dec Size
next
` Don't need this - just sorting so you can see there are no dups
sort array range Deck(), 1, CARDS_NEEDED
for i = 1 to CARDS_NEEDED
print Deck(i)
next
wait key
Basically, it's pick a card from the 52, then swap it into position 1 in the array. Then pick a card from the remaining 51 and swap that into position 2. Then pick a card from the remaining 50 and swap that into position 3. Repeat until you have the number of cards you need in positions 1 to 10.
Just as you'd pick 10 random cards from the deck - you only pick from what is left unpicked which means that you don't need to check for duplicates at all.
BTW, the SWAP ARRAY ITEMS and SORT ARRAY RANGE are additions available via my plug-ins. If you don't want to use my plug-ins, then the swap is basically:
j = i + rnd(Size - 1)
tmp = Deck(i)
Deck(i) = Deck(j)
Deck(j) = tmp