Kbase P114364: What is the structure of an event driven program in Progress?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  17/03/2006 |
|
Status: Unverified
GOAL:
What is the structure of an event driven program in Progress?
FIX:
The following sample shows the general structure of an event driven procedure. Notice that the sample is organized into five sections:
1. Variable, parameter and object definition section.
2. Event trigger definition section.
3. Main block section.
4. User defined function definition section
5. Internal procedure definition section.
/*
* Section 1: Variable, parameter and object definition section
*/
DEFINE VARIABLE v-field1 AS CHARACTER INITIAL "Hello" NO-UNDO.
DEFINE VARIABLE v-field2 AS CHARACTER INITIAL "PROGRESS" NO-UNDO.
DEFINE VARIABLE v-field3 AS CHARACTER INITIAL "World" NO-UNDO.
DEFINE FRAME f-hello
v-field1 LABEL "Field 1"
v-field2 LABEL "Field 2"
v-field3 LABEL "Field 3"
WITH 1 COLUMN ROW 5 CENTERED NO-BOX.
*
* Section 2: Event trigger definition section
*/
ON RETURN OF v-field2 DO:
MESSAGE "In trigger for field2." VIEW-AS ALERT-BOX.
END.
/*
* Section 3: Main Block section
* Initialize user interface.
* Enable the user interface objects.
* Block for user input.
*/
DISPLAY v-field1 v-field2 v-field3 WITH FRAME f-hello.
ENABLE ALL WITH FRAME f-hello.
WAIT-FOR RETURN OF v-field3.
/*
* Section 4: User defined functions definition section
*/
/*
* Section 5: Internal procedures definition section */