LOOKUP ( expression , list , character )A constant, field name, variable name, or expression that results in a character value that you want to look up within a list of character expressions. If the value of expression is the Unknown value (?), the result of the LOOKUP function is the Unknown value (?).A character expression that contains the expression you name with the expression argument. Each entry in the list is separated with a delimiter. The list can be a variable of type CHARACTER or LONGCHAR. If list contains the Unknown value (?), LOOKUP returns the Unknown value (?).The following example uses a different delimiter, which list all fields that have “sls” or “sales” as words in their standard Dictionary labels:
FOR EACH _FieldWHERE LOOKUP("sls",_Field._Label," ") > 0OR LOOKUP("sales",_Field._Label," ") > 0:DISPLAY _Field._Field-Name _Field._Label.END.
If expression contains a delimiter, LOOKUP returns the beginning of a series of entries in list. For example, LOOKUP("a,b,c","x,a,b,c") returns a 2.
Most character comparisons are case insensitive in ABL. By default, upper-case and lower-case characters have the same sort value. However, you can define fields and variables as case sensitive (although it is not advised, unless strict ANSI SQL adherence is required). If the expression or list is defined as case sensitive, the comparison between them is also case sensitive and “Smith” does not equal “smith”.
The LOOKUP function is double-byte enabled. The specified expression can yield a string value that contains double-byte characters and the character delimiter can be a double-byte character.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |