Recent

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

coradi

  • Full Member
  • ***
  • Posts: 148
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
AVR8/ARM(STM32)

fred

  • Full Member
  • ***
  • Posts: 201
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 »

jamie

  • Hero Member
  • *****
  • Posts: 6130
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

  • Full Member
  • ***
  • Posts: 148
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
AVR8/ARM(STM32)

 

TinyPortal © 2005-2018