Random is a class that provides functions to produce random sequences. See examples in
Random Class[
^].
It's always advised to look up the class help files.
pin
for itself can not be used to do
...string + pin...
.
You have to get a random number first and store in a variable. Use that variable for your file name and for storing in the file.
Cheers
Andi