Hi,
There may be a blindingly obvious explanation for the following behaviour but, so far, I've missed it!
BTW, In practice I am use similar logic to break an output file into sizeable 5000 line chunks, so it has more of a purpose than this demonstration shows!...
Run the code as is, and as...