Endkey Pressed In An Update Does Nothing

I have a group of records that need to be updated. There are not many that need specific attention, but those that do require an end user to determine the correct value. In this case, it is a project number that needs to be updated.

So...
Code:
def var vend as char.
def var vend1 as char.
def var sdate as date.
def var edate as date.
proc-loop:
Repeat on undo, leave:
    FORM
        vend vend1
        sdate edate
        with frame x.
    FORM
        apreference skip
        vendno vendpo vendamt skip(2)
        approject
        with frame xx.
    For each aprecord
        where vendno >= vend and vendno <= vend1:
        if approject = "" then do:
            display apreference vendno vendpo vendamt with frame xx.
            update approject with frame xx.
            down with frame xx.
        end.
    END.
END.

In this example, if the user hits the endkey, it does not leave. I have tried a number of ways of getting this to work and have come up blank.

While in update mode, can "endkey undo, leave" be used? If not, how can I get the user out of this loop, should he/she need to do so? Ctrl-C is too messy inside of the application (QAD).

Any ideas?
 
Last edited by a moderator:
forgot to include
update vend vend1 sdate edate with frame x.

it is ahead of my for each.

I tried to minimize the amount of code to have to type in. Sorry!
 

Osborne

Active Member
While in update mode, can "endkey undo, leave" be used?
From an example in the manual it appears so:
Code:
/* r-undo.p */

DEFINE VARIABLE ans AS LOGICAL NO-UNDO.

REPEAT FOR SalesRep WITH ROW 7 1 COLUMN 1 DOWN CENTERED ON ENDKEY UNDO, LEAVE:
  PROMPT-FOR SalesRep.SalesRep.
  FIND SalesRep USING SalesRep.SalesRep NO-ERROR.
  IF NOT AVAILABLE salesrep THEN DO:
  ans = TRUE.
  MESSAGE "SalesRep record does not exist.".
  MESSAGE "Do you want to add a SalesRep?" UPDATE ans.
  IF ans THEN DO:
  CREATE SalesRep.
  ASSIGN SalesRep.SalesRep.
  UPDATE SalesRep.RepName SalesRep.Region SalesRep.MonthQuota.
  END.
  ELSE UNDO, RETRY.
  END.
  ELSE DISPLAY SalesRep.
END.
 
Top