Progress
Language Reference
EDITING Phrase
Identifies the process that follows each keystroke during a PROMPT-FOR, SET, or UPDATE statement. This is maintained primarily for compatibility with Progress Version 6 or earlier.
SYNTAX
statement
One or more statements you want to process, usually for each keystroke entered. In most cases, the first statement is READKEY.
EXAMPLEThis procedure lets you update the i variable, and immediately processes each of your keystrokes. The READKEY statement reads each of the keys you press. The APPLY statement applies, or executes, each keystroke. This is a very simple EDITING phrase and is the same as entering UPDATE i.
The following r-edit2.p procedure uses an EDITING phrase with an UPDATE statement to control what happens based on each keystroke during the UPDATE. Here, the user can press any key while updating any field except sales-rep.
While in the sales-rep field, the user can press SPACEBAR to scroll through the possible values for the sales-rep field. If the user presses the TAB, BACKTAB, GO, RETURN, or END-ERROR key, the procedure executes that key. If the user presses any other key while in the sales-rep field, the terminal beeps.
NOTES
- A READKEY statement does not have to be the first statement after the word EDITING. However, it should appear somewhere in the EDITING phrase because Progress does not automatically read keystrokes when you use an EDITING phrase.
- The EDITING phrase applies to the PROMPT-FOR part of a SET or UPDATE statement. Therefore, to examine a value supplied by the user (within an EDITING phrase), you must use the INPUT function to refer to the field or variable that contains the value.
- When you use the NEXT statement in an EDITING phrase, Progress executes the next iteration of that EDITING phrase and cancels any pending GO.
- When you use the LEAVE statement in an EDITING phrase, Progress leaves the EDITING phrase and executes the assignment part of the SET or UPDATE statement.
- Within an EDITING phrase, you cannot use the CLEAR ALL, DOWN, or UP statements on the frame being edited.
- If you hide and redisplay a frame while you are in an EDITING block, Progress might not redisplay it in the same location unless you specifically name the row and column of the frame. This could cause problems because the EDITING block does not recognize the new location, and attempts to update the fields at the old frame location.
- The EDITING phrase activates only for input from a terminal. If your input comes from an operating system file (set with the INPUT FROM statement), the EDITING phrase has no effect.
- The EDITING phrase is incompatible with event-driven programming. An EDITING block might interfere with other event handling statements.
- For more information on EDITING blocks and other ways of monitoring keystrokes, see the Progress Programming Handbook .
SEE ALSO
END Statement, PROMPT-FOR Statement, READKEY Statement, SET Statement, UPDATE Statement
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |