You example doesn't raise an exception because EOF has been reached after the second ReadLong().
This causes, internally, ReadBytes() to return 8, and not throw an exception.
One way to get the execption is to ReadInt() on the second read, and then on the third, ReadLong().
One might consider this a bug, since now you have reached EOF, you can keep "reading" without error.
Then again, perhaps you are meant to check EOF after every read.
But supposedly, you might also consider that an exception would be thrown if you tried to read past the end of the file - if EOF was true or not.
But Try/Catch in BlitzMax generally works well. You can even throw them from C/C++, which is cool :-)
This causes, internally, ReadBytes() to return 8, and not throw an exception.
One way to get the execption is to ReadInt() on the second read, and then on the third, ReadLong().
One might consider this a bug, since now you have reached EOF, you can keep "reading" without error.
Then again, perhaps you are meant to check EOF after every read.
But supposedly, you might also consider that an exception would be thrown if you tried to read past the end of the file - if EOF was true or not.
But Try/Catch in BlitzMax generally works well. You can even throw them from C/C++, which is cool :-)