Output to screen or window

When a value is displayed to the 4GL screen or a 4GL window it either can contain the AT clause which specifies the exact position of the displayed information or it may be without the AT clause.

DISPLAY without AT

The DISPLAY statement can be followed by the Display Value and not followed by any optional display clauses:

The output will be performed to LyciaConsole.

 

The DISPLAY statement without the AT clause cannot be followed by an ATTRIBUTE clause, whereas a DISPLAY statement with any of the display optional clauses can.

 

The value can be displayed with the left offset, if the keyword COLUMN is used. The COLUMN keyword defines the offset by which the displayed value will be shifted to the right. The character string in the example below will be displayed at the fifteenth column of either the screen or Output console. If the length of the "var1" value is longer than 15 characters, the character string will be shifted to the right and displayed next to it.

DISPLAY var1, COLUMN 15, "definition"

 

You can use the SPACE operator to insert whitespaces between the display values. The integer preceding the SPACE operator specifies the number of white spaces inserted between the last character of the first value and the first character of the second one:

DISPLAY "first_value", 5 SPACE, "second_value"

 

In this case, the position of the second value does not have the absolute coordinates, it has coordinate relative to the position of the previous display value.

By default, output to LyciaConsole is disabled when running applications from LyciaDesktop or LyciaWeb (not from LyciaStudio).  You can enable output to LyciaConsole by using the -c option for LyciaDesktop and console=page for LyciaWeb.

DISPLAY … AT

DISPLAY … AT statement has the following structure:

 

Display Value

An actual value enclosed in the double quotation marks, a variable which value is to be displayed or their combination separated by comas

Line

A 4GL expression returning a positive integer that specifies a line of the current 4GL window or 4GL screen

Column

A 4GL expression returning a positive integer that specifies a column on the specified line of the current 4GL window or 4GL screen

ATTRIBUTE clause

An optional ATTRIBUTE clause which affects the display attributes applied to the display value

AT clause specifies where the information will be displayed in a 4GL window. If the AT clause is omitted, the information will be displayed in the LyciaConsole.

 

Line is the line of the current window or 4GL screen, the column is the left offset that specifies the horizontal coordinates of the output with regard to the left side of a window or screen. The line and the column can be either literal integers, or integer expressions. Both the line and the column should be specified.

#the value is displayed at the 2nd column of the 5th line

DISPLAY var1 AT 5,2

 

The output from the DISPLAY ... AT statement will be performed at the specified line and column of the current window or of the 4GL screen, if it is used as the current window.

 

The 1,1 coordinates are located in the upper left-hand corner of a current 4GL window or of the 4GL screen. The first number refers to the lines, the larger is the number the lower is the line. The second number refers to the character position; the larger it is, the closer to the right side of the screen or a window the displayed information is situated.

 

If the coordinates specified in the AT clause exceed the size of a window or a screen, 4GL will not produce an error, but the displayed information will not be visible.

 

The information displayed remains on the screen until it is overwritten.

DISPLAY ... AT will not be executed for a form with any panel other than the CoordPanel.
When converting classic Lycia forms (.per) into the .fm2 forms, developers must change all the DISPLAY ... AT statements by the DISPLAY ... TO statements.
Only integers can be used to specify coordinates in DISPLAY ... AT statements (INTEGER, INT, SMALLINT, and BIGINT). No character values can be used in DISPLAY ... AT statements because the values which specify parameters are not converted, and any character value used to specify parameters will cause an error.

You cannot use the AT clause within a DISPLAY statement where the TO or BY NAME keywords are used. The ATTRIBUTE clause cannot be used with a DISPLAY statement that does not contain any other clauses (AT, TO, BY NAME).

 

4GL reserves the default positions for:

 

It is advisable that you do not specify the above listed coordinates in the AT clause of a DISPLAY statement, otherwise the corresponding messages will be overwritten. If you need to use these coordinates, you can change the position of the default lines using the OPTIONS statement.

Display format

Display value of the DISPLAY statement can contain several literal values or variables. They should be separated by comas.

DISPLAY variable1, "value", variable2 AT line_var, 3

 

You can also use the following tools to format the output:

The items, displayed with the help of the same DISPLAY statement are not separated by white spaces automatically, use SPACE or COLUMN operator to insert white spaces where necessary.

Here is an example of the DISPLAY statement used with several operators:

DISPLAY "If c=", c CLIPPED, 1 SPACE, "then the expression is correct."

 

The length of the displayed variable depends on its declared data type, if you do not use the CLIPPED operator:

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.