An ABL procedure consists of statements
- Last Updated: January 16, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
An ABL procedure is made up of a sequence of language statements. Each
statement has one or more ABL keywords, along with other tokens such as database field
names or variable names. An ABL statement normally ends with a period. By convention, a
statement that defines the beginning of a block, such as your FOR EACH Customer statement, can end with a colon instead. There is no
significance to the end of the line in ABL. A single statement can span multiple lines,
and if you wish, there can be multiple statements on a single line. There is no special
syntax needed to break up a statement between lines, but if you have a single element of
a statement, such as a quoted string, that is long enough that you need to make it span
lines, then end the first line with a tilde character (~).
There must be at least one space (or other white space character such as a tab or new line) in between each token in the statement. ABL is not sensitive to additional white space. You can indent lines of code and put tabs between parts of a statement for readability, and none of this will affect how the statement executes.
ABL is case-insensitive. This means that you can write either an ABL keyword or a reference to a variable name, or database table or field name, in any combination of uppercase and lowercase letters. For a list of all the ABL keywords, see the ABL Reference.
When you define variables in a procedure, and when you define database tables
and fields, you must give them names that begin with a letter. After that, the name can
include letters, numeric digits, periods (.), hyphens
(-), and underscores (_). When you save your ABL
procedure, you give it a name as well, and this follows the same naming rules. Note
that, although ABL itself has many hyphenated keywords, you should not use hyphens in database table and field names, as well as procedure and
variable names in your application. You should follow this guideline because other
programming languages that you might want to combine with ABL procedures often do not
allow a hyphen as a character in a procedure or parameter name. And the SQL database
access language, which you can also use to manage data in your OpenEdge database using
other tools, does not allow hyphens in table and field names.
A good naming convention for all kinds of names in ABL procedures is to use
mixed case (as with the CustNum field) to break up a name into multiple
words or other identifiable parts. Using capital letters to identify the beginning of
each word or subpart within the name improves the readability of your code.