Recent

Author Topic: exitcode = 201?  (Read 664 times)

coradi

  • Jr. Member
  • **
  • Posts: 91
exitcode = 201?
« on: October 13, 2019, 11:58:28 am »
Hi,
sorry, I don't know how I get it from Windows FPC to clipboard.
If I count X to 100 it works..if I count to 1000, then comes exitcode 201?!
It's an Integer?!
Higher than 234 doesn't work?!

IT has something to do with the inc(d); but why?
« Last Edit: October 13, 2019, 12:07:22 pm by coradi »
Amstrad Schneider CPC 6128
Wind XP / 7 / 10

fred

  • Full Member
  • ***
  • Posts: 184
Re: exitcode = 201?
« Reply #1 on: October 13, 2019, 12:09:28 pm »
140 * 100 = 14000
140 * 234 = 32760
Both fit in a signed integer

140 * 1000 = 140000
Does not fit in a signed integer, 201 Range check error

https://wiki.freepascal.org/Integer

edit: added link to integer datatype
« Last Edit: October 13, 2019, 12:17:36 pm by fred »
Started with OmegaSoft Pascal on OS-9/68k , now Lazarus 2.0.8 / FPC 3.0.4 on Windows 7

jamie

  • Hero Member
  • *****
  • Posts: 3246
Re: exitcode = 201?
« Reply #2 on: October 13, 2019, 06:01:58 pm »
its because integer in that mode is only 16 bit, the largest number you can use without it going to the - side is 32767.

 Instead of using Integer, use LongInt; LongInt will do much more!
The only true wisdom is knowing you know nothing

coradi

  • Jr. Member
  • **
  • Posts: 91
Re: exitcode = 201?
« Reply #3 on: October 13, 2019, 06:19:07 pm »
Yes, thanks too both from you.
My mis thinking was..I reset with each loop the variable..but forget..d wasn't reset..and increase more and more every time
Amstrad Schneider CPC 6128
Wind XP / 7 / 10

 

TinyPortal © 2005-2018