If CommPort needs to be a numeric value, just reading in the file won't work.
If you really have a comport.txt file containing only a 5, this still is a string read in by FILETOSTR(), as the name of the function tells, it reads a file to a string variable. There are much better ways to store configuration values, for example as you use VFP a DBF. Sure, a DBF with a numeric field storing a 5 would be much larger than the single byte txt file, but it's obviously not the end of what configuration values can be in data.
Another very old school way is the INI format, it's easy to maintain, as it's just a text file, too, and therefore still in use in many cases, though today many configurations are stored into XML files, still also text, but not very maintenance friendly for just using an editor. But there are also many new tools that format XML for easier handling.
I'd consider moving away from the single number in a text file, to anything else, but for the moment you'd need VAL(FILETOSTR("comport.txt")) as your comport number.
Chriss