### Expression for a Negative Range of Values

Posted:

**06 Jun 2018, 12:54**I have issues with invalid results from NEGATIVE values. I'm creating a Character tracking MAP for a game.

The problem is, If I say:

Var is less than -100.

Var is between -1 and -10

BOTH returns invalid/wrong results.

The Expressions below are invalid as well:

Var < -100

(Var <= -1) && (Var >= -10)

All positive functions in the code below works perfectly. Just the Negative ones are jacked up.

Assistance would be much appreciated.

I'm testing other things. I think I may have solved the problem....

The problem is, If I say:

Var is less than -100.

Var is between -1 and -10

BOTH returns invalid/wrong results.

The Expressions below are invalid as well:

Var < -100

(Var <= -1) && (Var >= -10)

All positive functions in the code below works perfectly. Just the Negative ones are jacked up.

Assistance would be much appreciated.

I'm testing other things. I think I may have solved the problem....

Code: Select all

```
POSITIVES
;---------<VALUE = 6.5 >---------------------------------------------------------->
If a between 16576 and 16600
{
var1=6.5
IniWrite, %var1% , %A_ScriptDir%\DoA.ini, DISTANCE, X1
}
If b between 16576 and 16600
{
var2=6.5
IniWrite, %var2% , %A_ScriptDir%\DoA.ini, DISTANCE, X2
}
POSITIVES
;---------<VALUE = 7 >---------------------------------------------------------->
If a between 16601 and 16700
{
var1=7
IniWrite, %var1% , %A_ScriptDir%\DoA.ini, DISTANCE, X1
}
If b between 16576 and 16700
{
var2=7
IniWrite, %var2% , %A_ScriptDir%\DoA.ini, DISTANCE, X2
}
NEGATIVE VALUES
;---------<VALUE = -1 >---------------------------------------------------------->
If a < -16000
{
var1= -1
IniWrite, %var1% , %A_ScriptDir%\DoA.ini, DISTANCE, X1
}
If b < -16000
{
var2= -1
IniWrite, %var2% , %A_ScriptDir%\DoA.ini, DISTANCE, X2
}
```