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.

Table 1. Date functions
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:

  1. In the Procedure Editor, select File > New Procedure Window to open a new procedure window.
  2. Enter the following code, which applies the STRING function to the result of the TIME function, along with the formatting characters HH (hour), MM (minute), and SS (second):
    DISPLAY STRING(TIME, "HH:MM:SS").
  3. 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.

Table 2. List functions
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.