Hello Krille,
Refnum is a reference to an object or procedure you are operating with.
In your case, it is a reference to the file you will write to.
To write to a file, you must open it first, the "Open/Create/Replace File" function will do that and will return a refnum for you to connect to your write file function.
Hope this helps,
Paulo