ENTRY function
Returns a character string (CHARACTER or LONGCHAR) entry from a list based on an integer position.
Syntax
element
An integer value that corresponds to the position of a character string in a list of values. If the value ofelement
does not correspond to an entry in the list, the AVM raises the ERROR condition. If the value ofelement
is the Unknown value (?
), ENTRY returns the Unknown value (?
). Ifelement
is less than or equal to 0, or is larger than the number of elements inlist
, ENTRY returns an error.list
character
ExamplesThis procedure returns the day of the week that corresponds to a date the user enters. The WEEKDAY function evaluates the date and returns, as an integer, the day of the week for that date. The ENTRY function uses that integer to indicate a position in a list of the days of the week.
This is an example of a list separated by dashes instead of commas (the result is “helvetica”):
The next procedure looks up UNIX login IDs in a small password array and returns the name of the user:
NoteThe ENTRY function is double-byte enabled. It can return an entry that contains double-byte characters from a specified list and the
character
delimiter can be a double-byte character.See also
OpenEdge Release 10.2B
|