Click or drag to resize

Between Function

Determine if a value is between two other values.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.07
Syntax
 FUNCTION Between(
	uValue AS USUAL,
	uMin AS USUAL,
	uMax AS USUAL
) AS LOGIC
View Source

Parameters

uValue
Type: Usual
A value of any type to compare to <uMin> and <uMax>.
uMin
Type: Usual
The point at which to start comparing.  This must be of the same type as <uValue> except that numerics of different types are allowed.
uMax
Type: Usual
The point at which to stop comparing. This must be of the same type as <uValue> except that numerics of different types are allowed.

Return Value

Type: Boolean
TRUE if <uValue> is greater than or equal to <uMin> and less than or equal to <uMax>; 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 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:
X#
? Between("cd", "ab", "ef")        // TRUE
? Between("cd", "gh", "kl")        // FALSE
This example determines whether today's date is between 12/12/93 and 12/12/94:
X#
// Return value depends on today's date
? Between(Today(), 93.12.12, 94.12.12)
This example does comparisons based on numbers:
X#
? Between(2, 1, 3)                // TRUE
See Also