When you open a file FOR OUTPUT you already reset its contents, so you don't need to use a temp file if you intend to overwrite the contents of an existing file. Just open Off_Pilots.txt FOR OUTPUT to begin with and write to it as you already do. No previous contents will remain that way.
As usual, my own code confuses me, but I'm quite sure that I need the temp file at first, as
Off_Pilots.txt already exists, and I need to place the
end part of it into the temp file to preserve those lines of text. After which, more lines will be appended to it. Make sense?
Thanks, Fellippe, and Happy Anniversary!
Fuller version of my code:
WHILE NOT EOF(1) 'Record the last 25 Pilots removed from duty IF P
> PilCnt
- 25 THEN PRINT #2, P$
'Write the names to temp file