SP_HELP

HELP()

  Short:
  ------
  HELP() Provides context sensitive popup help

  Returns:
  --------
  Nothing

  Syntax:
  -------
  SET KEY xxx TO HELP

  Description:
  ------------
  By setting a key xxx to this function, the current
  PROC and VARIABLE are passed to it when the key is pressed
  during the program.

  By comparing the PROC and VARIABLE parameters against
  entries in the HELP.DBF, HELP() can then provide the appropriate
  help screen for the user. If no matching record is found, HELP()
  displays a 'No Help Found' message to the user.

  HELP() works in conjunction with HELPMOD() which is
  used to create help screen records for the HELP.DBF. HELPMOD()
  allows online creation and modification of the size, location
  and contents of the help screen for the current PROC,VARIABLE
  combination.

  Examples:
  ---------
   EXTERNAL HELP

   SET KEY 28 to HELP

  Warnings:
  ----------
  The SET KEY that called this proc is still active
  inside the proc. You may wish to modify the proc to turn off/on
  the set key.

  i.e. if called with key 28 (F1)

  at start :  SET KEY 28 to
  at end:     SET KEY 28 to HELP

  Notes:
  -------
  Will not be much use during ACHOICE or MENU TO

  Source:
  -------
  S_HELP.PRG

 

Message multiple values

MsgMulti ( aka MsM) is a message function accept multiple and any type of data.

Download here ( source only ).

Main Menu

HMG Tutor 2

Adding The Main Menu

We add a main menu to the program now:

#include "hmg.ch"
Function Main
DEFINE WINDOW Win_1 ;
   AT 0,0 ;
   WIDTH 400 ;
   HEIGHT 200 ;
   TITLE 'Tutor 02 - Main Menu Test' ;
   MAIN
   DEFINE MAIN MENU
      POPUP "First Popup"
         ITEM 'Change Window Title' ACTION  Win_1.Title := 'New Title'
         ITEM 'Retrieve Window Title' ACTION  MsgInfo ( Win_1.Title )
      END POPUP
   END MENU
END WINDOW
ACTIVATE WINDOW Win_1
Return

As you can see it is pretty easy and intuitive.

All the main menu stuff will be between DEFINE MAIN MENU / END MENU statements.
Each individual menu popup will be between POPUP / END POPUP statements.
Each individual menu item will be coded via the ITEM statement.

You can use as popups as you need and you can nest it without any limit.

By the way, another handy feature, a Message function used here :

The MsgInfo() Function

This is a very useful function. It will show a little message window (with the system information icon) and a message (character type) passed as parameter.

You can optionally add a title (passed as the second parameter).

Note: By nature, Message function uses options in local language. Here “Tamam” means “Ok” in my language ( Turkish).