Personally, I think using hash tables for cards is much easier. You can easily remove the cards from the hash table as they are used. Then, you can reshuffle by just reloading the table. Quick, easy, efficient.

If you're using a normal $rand like was mentioned in the first response, you can also just keep adding to the variable:
set %cardsused %cardsused $rand(1,52)
The results would be (for 3 "draws"):
5
5 8
5 8 51
You can then just do a check on the variable to see what numbers are used (use $istok to see if the number was used).

Still, RusselB's answer should work just fine as well (I can't test and didn't read through it, but he's usually right).

Just letting you know some other methods.