INMEMO provides three methods of translating function keys. One uses the same scheme as INFLD, which consists of an M68 file which you customize for your particular terminal. A sample file is provided on the release tape, WYSE5X.M68. If you print the file, you should be able to understand how to modify the program for other terminals and translation sequences. Basically, you just have to change the OBJNAM command near the top so that the assembled module has the same name as the terminal driver it applies to, and an extension of IMX. The other change is to the table at the label XLTTAB:. This method is a bit cumbersome since you have to deal with source code and assembly; its main advantage is that it provides a structure for loading and clearing the function key labeling lines that is somewhat more flexible than what the standard TAB(-1,X) commands allow. The FUNKEY.SBR subroutine is provided (see source file FUNKEY.M68 for documentation) to allow access to the load label line, clear label line, and translate function key sequence from within BASIC.
The second method of translating function keys is based on the standard used by MULTI, AlphaCALC, AlphaWRITE, AlphaBASE, etc. This method requires a utility program which builds a table for you by allowing you to hit the various function keys and then key in the translation. Alpha Micro makes available such a program called FIXTRN.LIT, which you may already have on your system. (It comes on the later 2.x release tapes and is readily available from other sources.) The advantages of this method over the previously described method are that the output of the translation can be several characters in length (not just one), and it is much easier to create the tables.
The third method is very similar to the second method but uses the SET PFK system command to build and maintain the tables. Internally, the format of the SET PFK and FIXTRN tables are different, but for all other practical purposes, they behave the same.
Note that the use of translation tables is optional. All functions are accessible through simple control-key sequences patterned after VUE. If you do decide to use function keys, whichever method you use, two rules apply:
The function key translation file must have the same name as your terminal driver, with an extension of IMX.
The function key translation file must be in system or user memory when INMEMO is called in order to be active. The reason for this is that unlike most programs which use translation tables (VUE, CALC, WRITE, etc.), INMEMO is running under BASIC's xcall memory management which does not allow for the standard operation of fetching a module from disk into memory. Besides, if your application uses INMEMO, it probably calls it a lot, and therefore you wouldn't want to fetch the translation table from disk each time. The best way to handle this is to construct tables for all your terminal drivers and then load them into system memory with the SYSTEM command in your system initialization file. Since you are loading them in memory, it doesn't make any difference where they are on disk - we recommend that you leave them in your INMEMO: ersatz account.
Note that when INMEMO finds an xxxxxx.IMX file in memory that matches your terminal driver name, it determines which of the two types of translation tables it is based on the internal format, so there is no need to tell INMEMO which type you are using.
Besides the three translation table formats, there are two fundamentally different things that can be accomplished with a single key translation. The first is called an editing translation, and simply replaces the function key with a one or more characters which are processed as if they were typed individually. For example, you could translate F1 to insert 3 lines and type the firm's name and address. The second method is called a command exitcode translation, and is used to exit from memo editing, update the memo, and return an exitcode to the calling program (as a signal to perform some other processing.) To set up command translations, just define the function key to send Control-G followed by a control character whose ASCII value is equal to the absolute value of the exitcode you wish to send. (Exit codes come back as negative values.) For example, to program F4 to send exitcode 4, translate it to Control-G followed by Control-D (since Control-D is the 4th character in the ASCII collating sequence.)
The comments in the preceding paragraph only apply to function key translation table made with FIXTRN or SET PFK; the proprietary format translation tables do not allow multiple character translations but automatically allow for command exitcode translations. See the discussion of the EXTCTL: Extended options parameter for more information on command exit codes, and the notes on the CHFUNC utility for information on checking the format and contents of translation tables.