cursor-offset on leave of fill-in

DOKTORF

New Member
Hello.
I have problem setting cursor-offset in on leave event of tty. Need help.
openedge 12.2 win64 tty
Code:
ON LEAVE OF cfrm-store IN FRAME fmnu
DO:
   DO ON ERROR UNDO, RETURN NO-APPLY:
     ASSIGN cfrm-store.
     icfs = chk_store(cfrm-store).
     IF icfs = 0 THEN
        LEAVE.       
      SELF:CURSOR-OFFSET = icfs.           
      RETURN NO-APPLY.
   END.
END.
 

DOKTORF

New Member
Oh, my bad.
I have a string of comma separated items that the user fills in manually. Elements have a certain structure, and the chk_store method checks each element for correctness of filling and returns the position of the beginning of the first incorrectly filled element. I want that at the on leave event, if there is an incorrectly filled element in the line, then the cursor will move to the position of the beginning of this element. The problem is that the cursor-offset is not set to the position I need when executing the code below.

Code:
ON LEAVE OF cfrm-store IN FRAME fmnu
DO:
   DO ON ERROR UNDO, RETURN NO-APPLY:
     ASSIGN cfrm-store.
     icfs = chk_store(cfrm-store).
     IF icfs = 0 THEN
        LEAVE.       
      SELF:CURSOR-OFFSET = icfs.           
      RETURN NO-APPLY.
   END.
END.
 

DOKTORF

New Member
on leave doesn't work in the console, at least with this syntax, but it works fine in prowin.

Code:
def var c as c no-undo init '1234567890' FORMAT 'x(20)'
.
DEF VAR d AS c NO-UNDO INIT '1234567890' FORMAT 'x(20)'  .
def button bok auto-go.
def frame f
skip(1)
c
SKIP(1)
d
skip(1)
bok
with view-as dialog-box side-labels.

on leave of c,d in frame f
do:
assign c d.
IF  length(SELF:SCREEN-VALUE) <= 10  THEN
DO:
    
    SELF:CURSOR-OFFSET = length(SELF:SCREEN-VALUE) + 1.
    RETURN NO-APPLY.
END.
end.

display c d with frame f.
enable all with frame f.
wait-for go of frame f.
 
Top