Can anyone please tell me why the following does not throw an exception, it just keeps running well beyond the end of the file
As I understand it, As soon as any of the stream reading command get to the end of the file they throw a TStreamReadException which my try block should pickup, but it does not. What am I doing wrong. I plan to use the block to detect errors in case of a short file.
Cheers.
'exception test SuperStrict Local infile : TStream = ReadFile("<replace with any short text file>") Local count : Long Local tvar : String If Not infile Print "not loaded" End End If Repeat Try tvar = ReadString(infile , 10) Print tvar count :+ 1 Catch a : Object Print a.ToString() End EndTry Print count Forever
As I understand it, As soon as any of the stream reading command get to the end of the file they throw a TStreamReadException which my try block should pickup, but it does not. What am I doing wrong. I plan to use the block to detect errors in case of a short file.
Cheers.