Hi Silvia.
MKinzler already posted the solution.
You have to place an @-sign before tmp when passing it to BlockWrite and / or BlockRead, because they expect their second parameter being a pointer to a memory location where to put the value read from the file.
This should work:
Code:
BlockWrite(MFile, [color=#ff0000][b]@[/b][/color]tmp, SizeOf(integer));
//edit:
Whoops. I was wrong. It is no pointer.