Between Function | |
Determine if a value is between two other values.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION Between(
uValue AS USUAL,
uMin AS USUAL,
uMax AS USUAL
) AS LOGIC
public static bool Between(
Usual uValue,
Usual uMin,
Usual uMax
)
Request Example
View SourceParameters
- uValue
- Type: Usual
A value of any type to compare to uMin and uMax.
- uMin
- Type: Usual
The minimum value to compare with.
This must be of the same type as uValue except that numerics of different types are allowed.
- uMax
- Type: Usual
TThe maximum value to compare with.
This must be of the same type as uValue except that numerics of different types are allowed.
Return Value
Type:
Logic
TRUE if the value is greater than or equal to the minimum and less than or equal to the maximum otherwise, FALSE.
Remarks
Between() can be used to do advanced searching on polymorphic data types.
For example, it can determine whether
A character falls between 2 other characters, either in the alphabet or the ASCII chart
A date falls between 2 other dates
A number falls between 2 other numbers
Tip |
---|
String comparisons: String comparisons are nation-dependent. Be aware that a character can fall between 2 other characters in the ANSI character set but not in the OEM character set. Thus, when passing strings you may often need to specify whether the ANSI or the OEM character set should be used.
Floating point comparisons: SetFloatDelta() affects the outcome of Between().
|
Examples
These examples show what would happen if you use Between() to search for the letters "cd" in a list of the alphabet:
1? Between("cd", "ab", "ef")
2? Between("cd", "gh", "kl")
This example determines whether today's date is between 12/12/93 and 12/12/94:
1
2? Between(Today(), 93.12.12, 94.12.12)
This example does comparisons based on numbers:
See Also