To meet your needs, we constantly work to improve Querix products.
This means that Lycia documentation is developing as well.
In case you have found a certain dissonance between the provided information and the actual behavior of Lycia 3 and/or your applications, please, let us know about this via documentation@querix.com so that we can introduce the necessary changes to our documentation.
Thank you for your attention and cooperation.
CLIPPED operator takes a character operand and returns the same character value, but without any following spaces.
Character expressions often have a data length less than their total size. The following DISPLAY statement, for example, would produce output that included 200 trailing blanks if CLIPPED were omitted but displays only 22 characters when CLIPPED is included. The following code sample illustrates the CLIPPED operator:
MAIN
DEFINE my_string CHAR(24)
LET my_string = "Test string char(24)"
DISPLAY "QX chars added to the end" at 5,5
DISPLAY "of unclipped string:" at 6,5
DISPLAY my_string, 'QX' at 8,5
DISPLAY "QX chars added to the end" at 10,5
DISPLAY "of clipped string:" at 11,5
DISPLAY my_string CLIPPED, 'QX' at 13,5
CALL fgl_getkey()
END MAIN
CLIPPED operator can be useful in the following kinds of situations:
After a variable in a DISPLAY, ERROR, LET, MESSAGE, or PROMPT statement, or in a PRINT statement of a REPORT program block
When concatenating several character expression into a single string
When comparing two or more character expressions and one or more of them is already clipped
CLIPPED operator can affect the value of a character variable within an expression. CLIPPED does not affect the value when it is stored in a variable (unless you are concatenating CLIPPED values together).
Relative to other 4GL operators, CLIPPED has a very low precedence. This can lead to confusion in some contexts, such as specifying compound Boolean conditions. For example, qfgl parses the condition:
IF LENGTH(f1) > 0 AND f1 CLIPPED != "first_name" THEN
as if it were delimited with parentheses as:
IF (((LENGTH(f1) > 0) AND f1) CLIPPED) != "first_name" THEN
To achieve the required result, you can write the expression as:
IF LENGTH(f1) > 0 AND (f1 CLIPPED) != " first_name " THEN
References: