Utility.Between(Check, Start, End)
.Between() checks to see if the first parameter is equal to or greater than the second parameter and less than or equal to the third parameter.
Applies To
Properties and Methods
None
Available
The .Between(Check, Start, End) method is available in:
- 15.03.016
- All newer builds
Type
Boolean
Syntax
Utility.Between(Check, Start, End);
Parameters
|
Parameter |
Required |
Description |
|---|---|---|
|
Check |
Yes |
Any value you want to test that is between the start and end value |
|
Start |
Yes |
The first value to compare to the check value. To return true this value must be less than or equal to (<=) the check value. |
|
End |
Yes |
The last value to compare to the check value. To return true this value must be greater than or equal to (>=) the check value. |
Example
Event.Form.MessageBox('Utility.Between(\'c\', \'a\', \'z\'): ' + Utility.Between('c', 'a', 'z') +
'\nUtility.Between(7, 1, 20): ' + Utility.Between(7, 1, 20) +
'\nUtility.Between(7, 10, 2): ' + Utility.Between(7, 10, 2) +
'\nUtility.Between(DateTime.Now, DateTime.Now.AddDays(-1), DateTime.Now.AddDays(1)): ' + Utility.Between(DateTime.Now, DateTime.Now.AddDays(-1), DateTime.Now.AddDays(1)) +
'\nUtility.Between(\'Wednesday\', \'Monday\', \'Friday\'): ' + Utility.Between('Wednesday', 'Monday', 'Friday') +
'\nUtility.Between(DateTime.Now, \'2021-10-01\', \'2021-10-31\'): ' + Utility.Between(DateTime.Now, '2021-10-01', '2021-10-31'));
/* Expected Prompt Response:
Utility.Between('c', 'a', 'z'): true
Utility.Between(7, 1, 20): true
Utility.Between(7, 10, 2): false
Utility.Between(DateTime.Now, DateTime.Now.AddDays(-1), DateTime.Now.AddDays(1)): true
Utility.Between('Wednesday', 'Monday', 'Friday'): false
Utility.Between(DateTime.Now, '2021-10-01', '2021-10-31'): false
*/