in reply to Shift function and file opening

Tricky indeed! And what is the context? Is it inside a function subroutine? Or is it the whole program?