Specify display format for variables
- Last Updated: August 3, 2020
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
The DISPLAY statement is an ABL statement that can be used for displaying output. This statement can be used in conjunction with the built-in user interface (UI). Most modern applications do not use the built-in UI for showing output, but the built-in UI can be useful when prototyping or debugging your code. The built-in UI is helpful when learning ABL, because you can try ABL code and quickly display the output without having to learn another UI.
When using the DISPLAY statement to
display the value of a variable, you can either use the ABL default display format for
the data type of the variable, or you can specify a custom display format. You specify a
custom format by using the FORMAT phrase in the DEFINE VARIABLE statement.
DEFINE
VARIABLE statement, with the FORMAT phrase,
is shown:
|
In the following example code, the DEFINE
VARIABLE statements for the myStrCustom
and myDecCustom variables override the default
formatting. myStrCustom is defined to display twenty
characters. myDecCustom is defined to display four
decimal places. For comparison purposes, two additional variables are defined, myStrDefault and myDecDefault, which do not alter the default formatting.
|
Running the code produces the following output:
|
For more information on the default display formats, see DEFINE VARIABLE statement.
MESSAGE statement.