Checks whether a variable's contents are numerically or alphabetically between two values (inclusive).
if Var between LowerBound and UpperBound if Var not between LowerBound and UpperBound
The variable name whose contents will be checked.
To be within the specified range, Var must be greater than or equal to this string, number, or variable reference.
To be within the specified range, Var must be less than or equal to this string, number, or variable reference.
If all three of the parameters are purely numeric, they will be compared as numbers rather than as strings. Otherwise, they will be compared alphabetically as strings (that is, alphabetical order will determine whether Var is within the specified range). In that case, StringCaseSense On
can be used to make the comparison case sensitive.
The "between" operator is not supported in expressions. Instead, use If statements such as if (Var >= LowerBound and Var <= UpperBound)
to simulate the behavior of this operator.
IfEqual/Greater/Less, if var in/contains MatchList, if var is type, IfInString, StringCaseSense, EnvAdd, Blocks, Else
Checks whether var is in the range 1 to 5.
if var between 1 and 5 MsgBox, %var% is in the range 1 to 5, inclusive.
Checks whether var is in the range 0.0 to 1.0.
if var not between 0.0 and 1.0 MsgBox %var% is not in the range 0.0 to 1.0, inclusive.
Checks whether var is between VarLow and VarHigh (inclusive).
if var between %VarLow% and %VarHigh% MsgBox %var% is between %VarLow% and %VarHigh%.