ABL functions
- Last Updated: May 9, 2024
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
This section provides a quick summary of some of the most useful functions
available to you in ABL:
- Date functions
- List functions
- String manipulation functions
Other sections of the book look at functions that convert data values and otherwise operate as part of data retrieval.
Date functions
The following table describes functions that return or operate on date values.
| Function | Description |
|---|---|
| DAY | Evaluates a date expression and returns a day of the month as an INTEGER value from 1 to 31, inclusive. |
| MONTH | Evaluates a date expression and returns a month INTEGER value from 1 to 12, inclusive. |
| YEAR | Evaluates a date expression and returns the year value of that date, including the century, as an INTEGER value. |
| WEEKDAY | Evaluates a date expression and returns the day of the week as an INTEGER value from 1 (Sunday) to 7 (Saturday) for that date. |
| TIME | Returns an INTEGER value representing the time as the number of seconds since midnight. Use this function together with the STRING function to produce the time in hours, minutes, and seconds. |
| TODAY | Returns the current system date. |
Functions that convert data are discussed in later sections. An example of such a function is the STRING function.
To see how you can use the STRING function
to convert the time into a meaningful display:
- In the Procedure Editor, select to open a new procedure window.
- Enter the following code, which applies the
STRINGfunction to the result of theTIMEfunction, along with the formatting charactersHH(hour),MM(minute), andSS(second):DISPLAY STRING(TIME, "HH:MM:SS"). - Press F2. The Procedure
Editor window appears:
List functions
The functions described in the following table operate on lists. All the list functions are one-based, that is, the first element in a list is considered to be element 1, not 0.
| Function | Description |
|---|---|
| ENTRY | 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. |
| LOOKUP | Returns an INTEGER value giving the position of an expression in a list. Returns a 0 if the expression is not in the list. |