Progress
Programming
Handbook


Program Structure in a Procedure-driven Program

The basic structure of a procedure-driven program is as follows.

  1. Test for a condition.
  2. Execute a block of code.
  3. Control the return.

The following example of a simple procedure-driven program using a FOR EACH loop illustrates this structure:

p-procd.p 
FOR EACH customer: 
  DISPLAY cust-num name phone WITH 6 DOWN. 
  PROMPT-FOR phone. 
  IF INPUT phone NE phoneyl 
  THEN DO: 
     MESSAGE "Phone Number changed". 
     BELL. 
  END. 
  ASSIGN phone. 
END. 

These notes help explain the code:


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