User Tools

Site Tools


inlist_return_entry_in_list_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== INLIST (return entry in list) ====== Previous pageReturn to chapter overviewNext page

INLIST(searchstring,liststring,liststring [,liststring…])

blk2blue.jpg

INLIST Returns item in a list.
searchstring A constant, variable, or expression that contains the value for which to search. If the value is numeric, it is converted to a string before comparisons are made.
liststring The label of a variable or constant value to compare against the searchstring. If the value is numeric, it is converted to a string before comparisons are made. There may be up to 25 liststring parameters, and there must be at least two.

The INLIST procedure compares the contents of the searchstring against the values contained in each liststring parameter. If a matching value is found, the procedure returns the number of the first liststring parameter containing the matching value (relative to the first liststring parameter). If the searchstring is not found in any liststring parameter, INLIST returns zero.

Return Data Type: LONG

Example:

INLIST('D','A','B','C','D','E') !returns 4

INLIST('B','A','B','C','D','E') !returns 2

EXECUTE INLIST(Emp:Status,'Fulltime','Parttime','Retired','Consultant')

 Scr:Message = 'All Benefits'        !Full timer

 Scr:Message = 'Holidays Only'       !Part timer

 Scr:Message = 'Medical/Dental Only' !Retired

 Scr:Message = 'No Benefits'         !Consultant

END

See Also:

CHOOSE

inlist_return_entry_in_list_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1