Weird integer behavior

Hello,
I’m doing some basic comparison with a negative integer value but xojo behaves in weird way.

I need to have the value compared to a reference value to have a text label changed depending on the value(a countdown). If the value is a value inbetween 0 and -119(so by any logic a bigger value than -120) i get a textstring else i get another one. If I use the “bigger than” operator the if criteria will fail and switch to the secondary else condition while by using the “less than” operator the if criteria will work like i am expecting to. Is it standard behaviour to compare two negative integer like they were positive numbers or should I file a bug report? I am using the latest version of Xojo (2015R4.1).

This is the code that is currently working(with a logic fallacy :slight_smile: )

    if Countdownval < -120 then
      Countdown.text = "text1"
    else
      Countdown.text = "text2"
    end if

Best Regards,
Matteo

How is the variable dim’d?

dim Countdownval as Integer

This works just fine here :

dim countdownval as integer = val(textfield1.text) if Countdownval > -120 then Countdown.text = "More than -120" else Countdown.text = "Less than -120" end if

The more explicit the message, the less confusion. Text1 and Text2 mean very little.

Rebooting os&IDE seems to have solved the issue. Thank you for your time :slight_smile: