ENTRY function
- Last Updated: October 16, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
Returns a character string (CHARACTER or LONGCHAR) entry from a list based on an integer position. The data type of the returned value matches the data type of the list element.
Syntax
|
- element
- An integer value that corresponds to the position of a character
string in a list of values. If the value of element
does not correspond to an entry in the list, the AVM raises the ERROR
condition. If the value of element is the Unknown
value (
?),ENTRYreturns the Unknown value (?). If element is less than or equal to 0, or is larger than the number of elements in list,ENTRYreturns an error. - list
- A list of character strings separated with a delimiter. The list can be a variable of type CHARACTER or LONGCHAR. If the
value of list is the Unknown value (
?),ENTRYreturns the Unknown value (?). - delimiter
- A single CHARACTER delimiter you define for the list. The default is a
comma. This allows the
ENTRYfunction to operate on non-comma-separated lists. If you use an alphabetic character, this delimiter is case sensitive.
Examples
This 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.
r-entry.p
|
This is an example of a list separated by dashes instead of commas (the result is "helvetica"):
r-entry2.p
|
The next procedure looks up UNIX login IDs in a small password array and returns the name of the user:
r-entry3.p
|
Notes
The 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.