As far as my testing goes it was not related to the compiler version (v5.5 and v6.0 at least did behave the same in this regard, working fine without notice under XP and resulting in the error message box under Win7/x64).
I have tested the original program in this thread under XP
So this adds another twist to the whole thing in that this works fine on a real lot of PCs under XP (we're using it in production code in several places and this error message box was never reported to have occurred), results in an error message box on at least one XP pc as well as some (all?) Win7 (x64 only?) PCs.
but internal write is only an back-handed external write where the 'file' is assumed to be large enough to take the data.
The 'file' is large enough, the write shall transfer 20 characters to a 20 characters-long string variable, or is there anything I'm missing?
Thanks for your testing, and the reports of other people.