Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Providing Help for OpenEdge Applications : Online help systems : The SYSTEM-HELP statement : Coding the help calling interface
 
Coding the help calling interface
This section explains some SYSTEM-HELP statement calls that are commonly used in the help calling interfaces of OpenEdge applications. For more information on the ABL elements described in the following sections, see OpenEdge Development: ABL Reference.
You can run the sample procedure, r-syshlpchm.p, to execute the help calls explained in this section. The source code example r-syshlpchm.p, is in the Documentation and Samples directory (doc_samples) on the OpenEdge product DVD. You can also obtain source code examples from the OpenEdge Documentation page on Progress Communities:
This procedure demonstrates several features of the SYSTEM-HELP statement with the Procedure Editor help file (editeng.chm). The user can click a button to demonstrate each of the following SYSTEM-HELP options:
*CONTEXT
*KEY
*ALTERNATE-KEY
*POSITION
*POSITION-MAXIMIZE
*QUIT
To run r-syshlpchm.p:
1. Copy editeng.chm from \Program Files\Progress\OpenEdge\prohelp to your OpenEdge working directory (by default, C:\OpenEdge\WRK).
2. Open r-syshlpchm.p in the Procedure Editor.
3. Press F2 to run the file.
When you click the buttons on the sample interface, r-syshlpchm.p calls the Procedure Editor help file, editeng.chm.
r-syshlpchm.p
/* r-syshlpchm.p *

/DEFINE VARIABLE helpfile AS CHARACTER NO-UNDO.

DEFINE BUTTON b_context LABEL "CONTEXT Call".
DEFINE BUTTON b_blank   LABEL "KEY Call-''".
DEFINE BUTTON b_single  LABEL "KEY Call-'Tools'".
DEFINE BUTTON b_full    LABEL "KEY Call- Tools;Menu".
DEFINE BUTTON b_max     LABEL "POSITION MAXIMIZE Call".
DEFINE BUTTON b_pos     LABEL "POSITION Call".
DEFINE BUTTON b_alt     LABEL "ALTERNATE-KEY Call".
DEFINE BUTTON b_quit    LABEL "QUIT Call".

FORM
  SKIP(1) SPACE(1) b_context SPACE(1)
  SKIP(1) SPACE(1) b_blank SPACE(1)
  SKIP(1) SPACE(1) b_single SPACE(1)
  SKIP(1) SPACE(1) b_full SPACE(1)
  SKIP(1) SPACE(1) b_max SPACE(1)
  SKIP(1) SPACE(1) b_pos SPACE(1)
  SKIP(1) SPACE(1) b_alt SPACE(1)
  SKIP(1) SPACE(1) b_quit SPACE(1)
  SKIP(1) WITH FRAME x.
ENABLE ALL WITH FRAME x.

helpfile = "editeng.chm".

/* The CONTEXT call displays the help topic associated with the
specified context number of a help topic (in this case, 49256, for the
   Using Editor Buffers topic). */
ON CHOOSE OF b_context IN FRAME x DO:
  SYSTEM-HELP helpfile CONTEXT 49256.
END.

/* The KEY call brings up the topic matching the string found in the
   keyword index. If the string parameter is empty or is omitted
  altogether, the help viewer displays with the Index tab on top.*/
ON CHOOSE OF b_blank IN FRAME x DO:
  SYSTEM-HELP helpfile KEY "".
END.

/* In a KEY call where the string parameter does not exactly match an
   index keyword of any help topic, the fill-in at the top of the Index
   tab is populated with the string that is passed in, and the default
   help topic is displayed. */
ON CHOOSE OF b_single IN FRAME x DO:
  SYSTEM-HELP helpfile KEY "Tools".
END.

/* In a KEY call where the string parameter exactly matches a unique index
   keyword of a help topic, the help engine automatically launches a help
   viewer window and displays the matching topic. Use semicolons to
   delimit multiple keywords.*/
ON CHOOSE OF b_full IN FRAME x DO:
  SYSTEM-HELP helpfile KEY "Tools;Menu".
END.

/* In an ALTERNATE-KEY call works like the KEY call but it uses the
   alternate keyword (Alink) index, if one is provided. */
ON CHOOSE OF b_alt IN FRAME x DO:
  SYSTEM-HELP helpfile ALTERNATE-KEY "Tools Menu".
END.

/* The POSITION X x Y y WIDTH dx HEIGHT dy call positions the open help
   window as specified */
ON CHOOSE OF b_pos IN FRAME x DO:
  SYSTEM-HELP helpfile POSITION X 2 Y 2 WIDTH 450 HEIGHT 450.
END.

/* The POSITION MAXIMIZE call maximizes the open help window as
   specified */
ON CHOOSE OF b_max IN FRAME x DO:
  SYSTEM-HELP helpfile POSITION MAXIMIZE.
END.

/* The QUIT call causes the help engine to terminate, unless another
application is using help. */
ON CHOOSE OF b_quit IN FRAME x DO:
  SYSTEM-HELP helpfile QUIT.
  RETURN.
END.

WAIT-FOR GO OF FRAME x.