Consultor Eletrônico



Kbase P109675: 4GL/ABL: How to limit EDITOR widget user input to a given number of lines?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   12/1/2008
Status: Verified

GOAL:

4GL/ABL: How to limit EDITOR widget user input to a given number of lines?

GOAL:

How to prevent EDITOR widget user input to exceed a given number of lines?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

FIX:

Create an ANY-KEY event trigger for the EDITOR widget and use the EDITOR's NUM-LINES to detect when the user tried to go beyond the specified number of lines:
DO:
IF KEYLABEL(LASTKEY) = "ENTER" THEN
IF SELF:NUM-LINES = 5 THEN DO:
RETURN NO-APPLY.
END.
ELSE
EDITOR-1:INSERT-STRING(CHR(10)).
END.