Adding Additional Processing to the Help Function

If you want to do additional processing before the help function is called or after the help function returns, you can write an event function that calls the data entry help function, kd_help(), or the choice list help function, kc_help(). You can include code to do the additional processing before or after the call to kd_help() or kc_help(). You may, for instance, want to conditionally change the help memory file before calling kd_help() or kc_help(), or you may want to call mf_rd() to read a text file into a memory file.

The following code example is for an event function that reads in a help memory file when the user invokes the function. The name of the help file for the form was stored in the form's user pointer by an earlier call to userp_set(). The current form pointer fmp is passed to the event function.

UCHAR *help_file;



    help_file = (UCHAR *) userp_get(fmp);

    help_mf(help_file, 200);

    kd_help(fmp);

If you already have a help file in memory, help_mf() does not free the existing help file. You should free the existing help file, or save a pointer to it so that you can reinstall it later, before calling help_mf(). To reinstall the previous help file, use se_helpmfp(), not help_mf(). help_mf() should only be used when the help file is not in memory.


Home Contents Previous Next