Developer Documentation Library > UNICOM Intelligence Function Library > List functions > Exists
 
Exists
This function checks whether a specified item is in a list.
This function can be used as an alternative to FindItem: it checks whether an item is in a list, but does not try to retrieve it.
Syntax
Exists(<list>, <key>)
Parameters
<list>
Type: None
Array, collection or Categorical value to operate on.
<key>
Type: None
Index, name, or value of the item to search for.
The way in which <key> is used on the type of the list: for more information, see FindItem.
(return)
Type: Boolean
This function returns True if a list or collection contains the specified item, or False if the list or collection does not contain it.
Examples
This example checks for item 10 in the list:
List = {8,5,7,1,3,4,9}
If Exists(List, 10) Then
Debug.Log(CText(10) + " exists")
Else
Debug.Log(CText(10) + " does not exist")
End If
See also
List functions