InListExact Function | |
Indicate whether the first expression in a series is repeated later in the series.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION InListExact(
uValue AS USUAL,
uValueList PARAMS USUAL[]
) AS LOGIC
public static bool InListExact(
Usual uValue,
params Usual[] uValueList
)
Request Example
View SourceParameters
- uValue
- Type: Usual
The value that is looked up in the list. This can be any data type.
- uValueList
- Type: Usual
A list of expressions separated by commas.
These expressions should be the same data type as the expression in uValue
If one or more of these expressions are not the same type as the first expression,
a runtime error may happening indicating a data type mismatch.
Return Value
Type:
Logic
TRUE if the first expression matches any of the other listed expressions; otherwise, FALSE.
Remarks InListExact() determines whether an expression is found in a series of expressions.
The first expression is compared to each of the other expressions until either a match is
found or the entire list has been traversed.
InListExact() is the same as InList() except that == is used for matching instead of =.
There is no difference between InList() and InListExact() for non string datatypes.
Examples
This examples use InList() to indicate whether the first expression in each series is repeated later in the series:
1? InList("b", "a", "b", "c")
2? InList("d", "a", "b", "c")
3nJack := 11
4nQueen := 12
5nKing := 13
6nAce := 14
7? InList(nJack, nQueen, nKing, nAce)
8? InList(nJack, nAce, nJack, nQueen, nKing)
Examples
This example compares InList() and InListExact() when the left operand in a comparison is longer than the right operand of a comparison:
1? InList("longer", "long")
2? InList("long ", "long")
3? InListExact("longer", "long")
4? InListExact("long ", "long")
This example compares InList() and InListExact() when the right operand in a comparison is longer than the left operand of a comparison:
1? InList("long", "longer")
2? InList("long", "long ")
3? InListExact("long", "longer")
4? InListExact("long", "long ")
See Also