I couldn't AC this simple problem for a long time because I used seekeof! I always got WA 1. When I change my code and replace seekeof by reading symbol-by-symbol and use eof, I get AC. I think it was a bug in FreePascal because I use Delphi and my program with seekeof successfully works on my computer. This is one more cause to replace FreePascal 2.0.4 by Delphi.