Results 1 to 3 of 3

Thread: Range check error in Val() function

  1. #1

    Range check error in Val() function

    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?
    Laserbrain Studios - Currently developing Hidden Asset!
    Ascii Sector
    - Real-time roguelike in space!

  2. #2

    Range check error in Val() function

    If you're on linux Integer is a SmallInt(16bit signed) in mode FPC. Either use longint or use ObjFPC
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #3

    Range check error in Val() function

    Oh, snap. I'm still too used to the old DOS Borland Pascal where integers were just integers. I completely forgot about smallint and longint. Thanks for the reply!
    Laserbrain Studios - Currently developing Hidden Asset!
    Ascii Sector
    - Real-time roguelike in space!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •