Progress
Help Development
Guide


Coding the Help Calling Interface

This section explains some SYSTEM-HELP statement calls that are commonly used in the help calling interfaces of Progress applications. For more information on the Progress language elements described in the following sections, see the Progress Language Reference.

You can run the sample procedure, r-syshlp.p, to execute the help calls explained in this section. This procedure demonstrates several features of the SYSTEM-HELP statement with the Procedure Editor help files (editeng.hlp and editeng.cnt). The user can select a button to demonstrate each of the following SYSTEM-HELP options:

Note that PARTIAL-KEY invokes the Help Topics dialog box with the Index tab on top.

The source code example r-syshlp.p, is in the library, prodoc.pl, in \Program Files\Progress\src or in the \src directory where Progress is installed. Follow the directions in the Preface for extracting files from libraries.

To execute r-syshlp.p, follow these steps:

  1. Copy editeng.hlp and editeng.cnt from \Program Files\Progress\prohelp to your Progress working directory (by default, C:\Progress\Wrk).
  2. Open r-syshlp.p in the Procedure Editor.
  3. Press F2 to run the file.
  4. When you click the buttons on the sample interface, r-syshlp.p calls the Procedure Editor help files, editeng.hlp and editeng.cnt:

    r-syshlp.p
    /* r-syshlp.p */
    
    DEFINE VAR helpfile as CHAR.
    
    DEFINE BUTTON b_help LABEL "FINDER Call".
    DEFINE BUTTON b_h6 LABEL "CONTENTS Call".
    DEFINE BUTTON b_h5 LABEL "CONTEXT Call".
    DEFINE BUTTON b_h4 LABEL "PARTIAL-KEY Call-".
    DEFINE BUTTON b_h3 LABEL "PARTIAL-KEY Call-’Tools’".
    DEFINE BUTTON b_h2 LABEL "PARTIAL-KEY Call-’Tools Menu’".
    DEFINE BUTTON b_h1 LABEL "HELP Call".
    DEFINE BUTTON b_quit LABEL "QUIT Call".
    
    FORM 
        skip(1) space(1) b_help space(1)
        skip(1) space(1) b_h6 space(1)
        skip(1) space(1) b_h5 space(1)
        skip(1) space(1) b_h4 space(1)
        skip(1) space(1) b_h3 space(1)
        skip(1) space(1) b_h2 space(1)
        skip(1) space(1) b_h1 space(1)
        skip(1) space(1) b_quit space(1)
        skip(1) WITH FRAME x.
    ENABLE ALL WITH FRAME x.
    
    helpfile = "editeng.hlp".
    
    /* The FINDER call brings up the Help Topics dialog box in its most
       recent state. */
    ON CHOOSE OF b_help IN FRAME x
    DO:
        SYSTEM-HELP helpfile FINDER.
    END.
    /* The CONTENTS call displays the main contents help topic. This 
       is for backward compatability with Windows 3.x. */
    ON CHOOSE OF b_help IN FRAME x
    DO:
        SYSTEM-HELP helpfile CONTENTS.
    END.
    
    /* The CONTEXT call displays the help topic associated with the
       specified context ID of a help topic (in this case, 49154). */
    ON CHOOSE OF b_h5 IN FRAME x
    DO:
        SYSTEM-HELP helpfile CONTEXT 49154.
    END. 
    
    /* The PARTIAL-KEY call brings up the Help Topics dialog box with
       the Index tab on top. When the string parameter is empty or is 
       omitted altogether, the fill-in at the top of the Index tab is 
       left blank.*/
    ON CHOOSE OF b_h4 IN FRAME x
    DO:
        SYSTEM-HELP helpfile PARTIAL-KEY "".
    END.
    
    /* In a PARTIAL-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 no help topic is automatically displayed. */
    ON CHOOSE OF b_h3 IN FRAME x
    DO:
        SYSTEM-HELP helpfile PARTIAL-KEY "Tools".
    END.
    
    /* In a PARTIAL-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. */
    ON CHOOSE OF b_h2 IN FRAME x
    DO:
        SYSTEM-HELP helpfile PARTIAL-KEY "Tools Menu".
    END.
    
    /* The HELP call brings up the Help Topics dialog box for the help file 
       that explains how to use Windows Help (winhlp32.hlp). */
    ON CHOOSE OF b_h1 IN FRAME x
    DO:
        SYSTEM-HELP helpfile HELP.
    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. 
    


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