[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
MENU HOOKS

     To use a procedure as a menu hook it must:

     1) Be a procedure declared with two passed parameters - a variable
     character, and an integer (indicating the return code of the
     highlighted topic). For example,

          PROCEDURE BOBS_HOOK(VAR C:CHAR;SELECT_CODE:INTEGER);
          BEGIN
              .............
          END;

     2) Be declared as a far procedure, i.e. precede the procedure with a
     {$F+} compiler directive and succeed the procedure with the {$F-}
     compiler directive.

     The technique of assigning or hooking the procedure for Turbo Pascal
     5.0 is different from version 4.0:

     Turbo 5 Users - the NTTT variable includes a field HOOK which should
     be set to the procedure name, e.g.

          NTTT.HOOK := BOBS_HOOK;

     Turbo 4 Users - a global variable Nest_UserHook (of type Pointer)
     should point to the procedure with the @ directive, e.g.

          NEST_USERHOOK := @BOBS_HOOK

     The Hooked procedure will be passed the character the user just
     pressed and the return code of the highlighted topic. The Hooked
     procedure can update the character pressed, and if the character is
     changed to a null (i.e. #0), then the pressed character is ignored,
     i.e. the system waits for the user to press another character. Change
     the character to an Enter (#13) to terminate the input.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson