Not pascal related but anyway just few days ago when working on my script compiler in C++ i had to write some stuff into compiled script. When i solve programming problems i often make small test apps and test the piece of code before copying to big project.

The test app wrote the data to file without problems, just the way i needed.
Then i just copy/pasted the code to my compiler source, which already has tons of .h / .cpp files and hundreds / thousands of lines, it just wrote the data partially, only first 2 bytes. The total was around 6000 bytes.

I tested many times this in my test app, with minimal code, looked what im doing etc, everything was correct. It was just very very weird. I couldnt understand how that can be. Just copy paste, small piece of code. Works in test app, but in compiler just 2 bytes.
This piece of code was almost at the end of main.cpp where all the writing is done.

And then i accidentally scrolled down near to the end of main.cpp and found that i had a piece of code in there (just a for loop) that filled all these 6000 bytes with 0. Except the 2 bytes, that was "header".

Removed that and all started to work. Because my old laptop screen is pretty small and i work with 1024x768, i dont see all of the code, i have to scroll a lot. Same with my PC monitor, very old and small.

So this code was outside of the view and did his job, directly i wrote the filled structs to file, it just replaced all data in them with 0.

Im planning to buy some 21" LCD, i never had such one but i would like to have it.