Page 1 of 1

Condition not respected problem

Posted: Tue May 21, 2024 10:32 pm
by le_magn
Hi all, I have a question, surely it will be something I miss, how come the first condition is executed as if the variable is greater than the compared number?

Code: Select all

StringSize.i = 1

If StringSize > 4278190079
  Debug "StringSize="+Str(StringSize)
  Debug "INSIDE"
EndIf

If StringSize > 10
  Debug "StringSize="+Str(StringSize)
  Debug "INSIDE2"
EndIf

Re: Condition not respected problem

Posted: Tue May 21, 2024 10:36 pm
by STARGÅTE
If you compiler with x86 (32 bit) .i is only 32 bit large, and 4278190079 is converted to -16777217 during the comparison, to match the size.
If you want a 64 bit comparison, you have to use StringSize.q

Re: Condition not respected problem

Posted: Tue May 21, 2024 10:42 pm
by le_magn
STARGÅTE wrote: Tue May 21, 2024 10:36 pm If you compiler with x86 (32 bit) .i is only 32 bit large, and 4278190079 is converted to -16777217 during the comparison, to match the size.
If you want a 64 bit comparison, you have to use StringSize.q
Yes, you are right, x86 compiler, if i use .q it work, thank you.