I'm trying to use the virtualtable as a sort of 'flat file database'.
The problem I have, is that I want to make sure that all changes to data are saved to file immediately, but if I try to SaveToFile on AfterPost, it causes problems. it seems that the OnPost event is called for every record when you first load the data from file so my SaveToFile procedure is called when I am trying to load the data initially, I can get around this with a Try .. Except condition, but it cant be the best way to do this, and also it makes debugging very difficult.

There is no such flag in VirtualTable, but you can implement it by yourself.
Another way is to detach the event before loading, and assign it after records has been loaded from the file. It may look like this: