next up previous
Next: Terminal Handling
Up: RETRIEVING HELP TEXT
Previous: The Input Subprogram

The Name Translation Subprogram

Help libraries have two names:

It is the job of the user-supplied NAMETR routine to translate the first form into the second.

The call is as follows:

CALL nametr (KMD, INSTR, OUTSTR, JSTAT)

where the arguments are:

The function number KMD is always zero when the NAMETR routine is called by the HLP system, and means `` INSTR is a help library name; translate it into a filename OUTSTR''. Non-zero KMD values are available to implementors for their own purposes.

The HLP package contains a suitable NAMETR routine, called HLP_NAMETR. The translation it provides is to enclose the supplied name within a prefix and suffix. This simple transformation adequately supports applications which must run on multiple platforms. The prefix and suffix are originally spaces, which HLP_NAMETR treats as meaning ``no translation required''. The full set of options supported by HLP_NAMETR is as follows:

This is what the application must do:

        :
*  Routines used by HLP_HELP
      EXTERNAL ...,hlp_NAMETR
        :
        :
*  Define prefix and suffix for help name translations
      CALL HLP_NAMETR(1,PREFIX,DUMMY,J)
      IF (J.NE.0) ... error
      CALL HLP_NAMETR(2,SUFFIX,DUMMY,J)
      IF (J.NE.0) ... error
        :
        :
*  Perform help session
      CALL HLP_HELP(...,HLP_NAMETR)
        :
An example prefix and suffix might be "/star/help/tpoint/" and ".shl" respectively. A library name "model" would then become the filename "/star/help/tpoint/model.shl".

If this simple prefix+name+suffix model is not adequate, the programmer is free to supply his own translation routine, perhaps using environment variables or an internal table.



next up previous
Next: Terminal Handling
Up: RETRIEVING HELP TEXT
Previous: The Input Subprogram



HLP --- Interactive Help System
Starlink User Note 124
P. T. Wallace
13th June 1995
E-mail:ptw@star.rl.ac.uk