Showing results for 
Search instead for 
Do you mean 

Range validation without restrictions

by Community Manager Community Manager on ‎06-15-2017 10:36 AM

I was searching for a way to check if a value is between a min and max value but not restricted to be within the range.  Here's how I did this:

 

Properties:

LS = 15

LS_Min = 11

LS_Max = 13

 

For the Rulestream Property LS I have not restricted the "Valid Values" to specific values, but instead am usinmg properites as shown here:

Validation.png

 

If I want LS to be 15 I cannot use a Valid Values as shown above as this value is out of range.  Therefore I create a boolean property "LS_Valid" wich is False by default.

 

In the LS property I use the following formula:

 

Me.Properties("LSValid").InputValue = (Me.Properties("LS").OutOfRange = 0)

 

Or you can also just check the property if it is out of range by using:

 

If (Me.Properties("LS").OutOfRange = 0) Then

   Result = something

End If

 

Note:  

  • OutOfRange determines if the value is outside of the min and max values set using the Valid Values tab of the Rulestream property.
  • Make sure there is not a Valid Values list because the OutOfRange check does not know how to compare against enumerated ValidValues and will always return 0.  Add < If not (myProp.HasValidValues) Then ... > to check for this.

 

Best Regards

Christian

 

Contributors