Progress
Language Reference
ON ENDKEY Phrase
Describes the processing that occurs when the ENDKEY condition occurs during a block. This condition usually occurs when the user presses END-ERROR during the first interaction of a block iteration, or any time the user presses a defined END-KEY.
If you use a REPEAT or FOR EACH block, the default processing for ENDKEY is to undo all the processing in the current iteration of the block, then leave the block and continue on to any remaining statements in the procedure.
SYNTAX
label1
The name of the block whose processing you want to undo. If you do not name a block with label1, ON ENDKEY UNDO undoes the processing of the block started by the statement that contains the ON ENDKEY phrase.
LEAVE [ label2 ]
Indicates that, after undoing the processing of a block,
Progress leaves the block labeled label2. If you do not name a block, Progress leaves the block containing the ON ENDKEY phrase. After leaving a block, Progress continues on with any remaining processing in a procedure.
LEAVE is the default if you do not specify LEAVE, NEXT, RETRY, or RETURN.
NEXT [ label2 ]
Indicates that, after undoing the processing of a block, Progress should execute the next iteration of the block you name with the label2 option. If you do not name a block with the NEXT option, Progress executes the next iteration of the block labeled label1.
RETRY [ label1 ]
Indicates that, after undoing the processing of a block, Progress should repeat the same iteration of the block that you name with the label1 option.
RETRY is the default if you do not specify of LEAVE, NEXT, RETRY, or RETURN.
RETURN [ ERROR | NO-APPLY ]
Returns to the calling procedure, or if there is no calling procedure, returns to the Progress Editor. Specifying ERROR causes the ERROR condition in the calling procedure. This causes the current subtransaction to be undone. You cannot specify ERROR within a user-interface trigger block. You can specify the NO-APPLY option only within a user-interface trigger block to prevent Progress from performing the default behavior for that event. For example, the default behavior for an character key press in a fill-in field is to echo the character in the field.
return-string
If you specify return-string, the string you provide is passed to the calling procedure. That procedure can use the RETURN-VALUE function to read the returned value.
EXAMPLEIn this procedure, if the user presses END-ERROR or END-KEY while changing the credit-limit field, any changes made during the current iteration of the block are undone, and the same iteration is run again. If this procedure did not use the ON ENDKEY phrase and the user pressed END-ERROR, the procedure ends because the default ENDKEY action is UNDO, LEAVE. After leaving the FOR EACH block, the procedure ends because there are no more statements.
SEE ALSO
ON ERROR Phrase, ON QUIT Phrase, ON STOP Phrase, RETURN Statement, RETURN-VALUE Function
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |