> On Oct 13, 2017, at 10:52 AM,

[hidden email] [netlogo-users] <

[hidden email]> wrote:

>

> How can I create an "if" function so that it's only true if a value is between two different values?

>

Start with pseudo-code. If the range values are a and b, you first need to find out which is larger. Then compare your test value, say v, with each as appropriate.

if a < b

in-range? is true if v > a and v < b

else

in-range? is true if v > b and v < a

If you consider v to be in range if it is equal to a or b, use <= and >= comparisons instead.

HTH,

Jim