Checks if a specific value is in a list or not.
List.bdh
ListContains( in theList: list, in element: union) : boolean;
Parameter | Description |
---|---|
theList | List of number, boolean, float or string. |
element | Element to be searched in theList. |
transaction TAListContains var lstNumber: list of number init 1, 2, 3; retVal1: boolean; nrVal: number init 2; begin retVal1 := ListContains(lstNumber, nrVal); writeLn("2 is element of the list: " + string(retVal1)); retVal1 := ListContains(lstNumber, 4); writeLn("4 is element of the list: " + string(retVal1)); end TAListContains;
2 is element of the list: TRUE 4 is element of the list: FALSE