Progress
Programming
Handbook


Overriding the Default Handling

You can override the default ENDKEY processing by adding the ON ENDKEY phrase to a block. Suppose you wanted Progress to undo more than the current iteration of the inner REPEAT block. That is, if you press F9 while entering an order–line, you want to undo all the work done on the current order and leave the procedure together:

p–txn9.p
ON F9 ENDKEY. 
o-block: 
REPEAT: 
  INSERT order WITH 2 COLUMNS. 
  FIND customer OF order. 
  0-1-block: 
  REPEAT ON ENDKEY UNDO o-block, RETRY o-block: 
    CREATE order-line. 
    order-line.order-num = order.order-num. 
    DISPLAY order-line.order-num. 
    UPDATE lin-num order-line.item-num qty. 
    FIND item OF order-line. 
    price = cost. 
    UPDATE price. 
  END. 
END. 

Here, the inner REPEAT block explicitly states that in the event of the ENDKEY condition, Progress does not undo the current REPEAT block but the outer o–block REPEAT block. In addition, it tells Progress to retry the o–block REPEAT block.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095