The [range] method tests a value to see if it exists within a given range. The method takes three parameters, the value to be tested and the minimum and maximum values of the test range. [range] will always return one of the three parameters it receives.
range(val, min, max) returns:
range( test_val, minimum, maximum )
Use the [range] method. This example normalises a set of data to fit within the specified range.
Code
var( myValues = array(22, 30, 17, 5, 16, 25, 21, 24),
constrainedValues = array )
with v in $myValues
do => {
$constrainedValues->insert( range( #v, 16, 24 ) )
}
$constrainedValues
Result
array(22, 24, 17, 16, 16, 24, 21, 24)
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments