reduce action segment

rickm

New Member
We currently have some includes which contain various triggers for events. For example ON ALT+F2 show a info screen, ALT+C show a calendar. This include is placed in every program. Another example would be, if the fill-in is a date field, the + would increment the date. All these includes are in the main block which eats up the action segment limitations.

We are running progress V9.1A.

Does anyone have some suggestions on relieving this code to an area that doesn't effect the action segment?
 

Chris Kelleher

Administrator
Staff member
Yes, and it's actually pretty simple: Just create two includes for each event, one for the trigger code which has just one line of code to run an internal procedure. The second include can contain the internal procedure itself. Since each IP get it's own action segment, this will drastically improve on the amount of code you have for the procedure's action segment, where all the trigger code goes.

For example:
Code:
/* trigf2.i */
ON 'F2':U, 'HELP':U
DO:
  RUN ipShowHelp IN THIS-PROCEDURE.
END.

/* showhelp.i */
PROCEDURE ipShowHelp:
  MESSAGE "This is your help...".
END PROCEDURE.

/* program.p */
{trigf2.i}
{showhelp.i}

-Chris
 
Top