After getting a value from "FREEFILE" you have to actually open a file successfully. Otherwise it will return the same value. In your code you commented out the "OPEN" statement and that's why it's not working.
Also never begin a variable name with "FN" because it's legacy part of "DEF FN". Instead of "AS ???" most of all you should use the long-integer variable return value from "FREEFILE" in the "OPEN" statement.
Also never begin a variable name with "FN" because it's legacy part of "DEF FN". Instead of "AS ???" most of all you should use the long-integer variable return value from "FREEFILE" in the "OPEN" statement.