Context Sensitive help

Posted by angiebauer on 12-Jan-2015 03:55

Hi there, could someone possibly help me with the code for linking our help files to our programs?

We already have some of the help written, in html files. What we will do is add a field to our menu table, and for each program name in there, we will in the new field, add the name of the html file to link those 2, so when we press the help key, it should only bring up that html file, depending on what program we are in.

Does anyone have code or an example of code, on how to get this done, so if we press F1 - go to the table, fetch the html file name depending on that program we are in, and then bring up that help file / html file.

Thanks!

All Replies

Posted by olivier.dunemann on 13-Jan-2015 06:58

You can put your code in the HELP event of the window:

ON HELP OF C-Win /* <insert window title> */
DO:
  FIND Program NO-LOCK WHERE Program.ProcFileName = THIS-PROCEDURE:FILE-NAME NO-ERROR.
  IF  AVAIL Program
  AND SEARCH(Program.HelpFileName) <> ?
  THEN System.Diagnostics.Process:Start(Program.HelpFileName).
END.

Posted by Roger Blanchard on 13-Jan-2015 07:26

We use html files as well but they are included in a .chm file so we only have to distribute the 1 help file. We then use the SYSTEM-HELP to open the help file. If you want to open a particular topic you can pass the html file as well

ASSIGN cTopicName = cTopicName + ".htm".

SYSTEM-HELP "unifypos.chm" HELP-TOPIC cTopicName.

This thread is closed