Desktop version

Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > Check if Number is in Range

Forum

Search UsersRules
Check if Number is in Range
#1
Active user
Points:: 3
Joined:: Sep 16, 2011

How can I check if the number X is in range between Y and Z? For example 2 = Range(from 3 to 5) is FALSE and 2 = Range(form 1 to 3) is TRUE.
Or maybe X in tolerance +/- Y, for example 2 = Range(5, +/-2) is FALSE and 2 = Range(3, +/-2) is TRUE.

Profile
#2
Active user
Points:: 0
Joined:: Nov 1, 2011

you can make a special function like this

Code
Function Range(Value, Min, Max)

    Return ?(Value>=Min And Value<=Max, True, False);

EndFunction

Profile
#3
Active user
Points:: 3
Joined:: Sep 16, 2011

Oh, thank you, Alexey! This works perfect for me!

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.