I've got a piece of code like this:

Code:
Val(TempString, TempInteger, ErrorCode);
TempInteger is an Integer, as is ErrorCode.

If TempString is for example '250', it works. But if it is for example '50000', I get a range check error. Why is that?