in_range()
This function takes 3 integer values as arguments and checks whether the 1st integer value is in the range between the two integer values provided by the 2nd and 3rd arguments. The valid range includes the values of the 2nd and 3rd arguments.
Function Prototype
in_range(needle,low,high)
Arguments
Argument Name | Data Type | Description |
---|---|---|
needle |
Integer Number | The value that is going to be checked whether it is in range. [required] |
low |
Integer Number | The smallest value of the valid range (including this value). [required] |
high |
Integer Number | The highest value of the valid range (including this value). [required] |
Return Value
Data Type | Description |
---|---|
Integer Number | Returns true (1 ) in case the value is in the allowed range, false (0 ) otherwise. |
Remarks
This functions accepts any standard unit and finalness for its two arguments, however the unit types of the two arguments must be identical. The return value does never contain a unit nor finalness.
Examples
The following example prints the result of some example argument values to the terminal as soon as the script is loaded.
- on init
- message("in_range(1,4,9) = " & in_range(1,4,9))
- message("in_range(5,4,9) = " & in_range(5,4,9))
- message("in_range(9,4,9) = " & in_range(9,4,9))
- message("in_range(10,4,9) = " & in_range(10,4,9))
- end on
Availability
Since LinuxSampler 2.0.0.svn36.
Document Updated: 2019-09-16 | Author: Christian Schoenebeck