Consultor Eletrônico



Kbase P107212: How to make the left-arrow/right-arrow in a TTY updatable browse jump to the next cell after reachin
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/4/2005
Status: Unverified

GOAL:

How to move focus (jump) to the previous
ext cell of a TTY updatable browse after reaching first/last position of the current cell using the LEFT/RIGHT arrow keys?

FIX:

Define a logical variable in the procedure of the browse and create the following two 'CURSOR-LEFT' and 'CURSOR-RIGHT' triggers for the browse:
DEFINE VARIABLE lJump AS LOGICAL NO-UNDO.
ON 'CURSOR-LEFT':U OF BROWSE bCustomer ANYWHERE
DO:
IF SELF:CURSOR-OFFSET = 1 THEN DO:
IF lJump = TRUE THEN DO:
APPLY 'CTRL-U' TO SELF.
ASSIGN
lJump = FALSE.
RETURN NO-APPLY.
END.
ELSE
ASSIGN
lJump = TRUE.
END.
END.
ON 'CURSOR-RIGHT':U OF BROWSE bCustomer ANYWHERE
DO:
IF SELF:CURSOR-OFFSET GE LENGTH(SELF:SCREEN-VALUE) THEN DO:
IF lJump = TRUE THEN DO:
APPLY 'CTRL-G' TO SELF.
ASSIGN
lJump = FALSE.
RETURN NO-APPLY.
END.
ELSE
ASSIGN
lJump = TRUE.
END.
END.