Sage-ST ä Tutorial
Lesson 24



1. Overview. In this lesson you will implement a help form from which the user may select the desired employee organization number. This help form will be displayed using HelpLib.


2. What You'll Use.
You will use the following new Sage-ST call:

HelpLib.UserHelp.


3. Assignment.
In the last lesson you created a CheckLib procedure to make certain that incorrect organization numbers could not be entered by a user. However, it is unlikely that users will have memorized every possible organization number, so you should probably provide them with a help form of some sort. Although you have created help forms in previous lessons, this one will be implemented differently.

Create a help form on which you hard code the organization number and names. Position on the first number of the OrgNum and define the field Employee.OrgNum to be a highlighted (Type 2) field. Lengthen the field to include the organization name.

Attach this form to the Employee.OrgNum fields on all applicable forms, but instead of typing in the actual name of the help form in the Help Form box, type in "USERHELP". Make the help form an autohelp. Recompile your SRC.

When a user requests a help form and the Sage-ST-reserved word "USERHELP" is encountered, HelpLib.UserHelp is called. As with CheckLib, a HelpLib.ADB currently exists in the Sage-ST library, but it consists only of a null statement. Thus, once HelpLib.UserHelp has been called by Sage-ST, you are free to do whatever you want inside it. For this lesson, simply put in a Display.DisplayForm for the help form you created.

Before compiling HelpLib.ADB it must be acquired into your library. The following command can be put into a batch file.

ada unit_manager(%1,update).acquire(helplib,c:\ada\sagelib,alternate,overwrite=yes)

where "%1" is the path and name of your library. At the DOS prompt, type in the batch file name and the path and name of your library.


NOTE: ada unit_manager is Alsys specific. If you use the Meridian compiler, you must compile the CheckLib.ADB into your local library .


HELPFUL HINT: Do NOT create or compile a HelpLib.ADS. However, if you do, delete your working library (not the Sage-ST library), reacquire HelpLib.ADB, and recompile and rebind your system.



4. Our Solution.


FORM REPORT FOR HRS

HpDeptV scrolling hp form--org number 5 Field(s)
packed picture size -> 94 bytes
predominant color -> light cyan on black
------------------------------------------------------------------------------







4C00 Technology Transfer
4C10 Special Applications
4C20 Scientific Computing
4C30 Env./Waste Mgmt. Comp.
4C50 Ind. Verification/Val.



-----------------------------------------------------------------------------

Field Display Type Record & (Field) - rpt Field Type Help Form
-----------------------------------------------------------------------------
1 Highlighted Employee(OrgNum) - 1 Alpha/Numbers
2 Highlighted Employee(OrgNum) - 1 Alpha/Numbers
3 Highlighted Employee(OrgNum) - 1 Alpha/Numbers
4 Highlighted Employee(OrgNum) - 1 Alpha/Numbers
5 Highlighted Employee(OrgNum) - 1 Alpha/Numbers

with Display;
with ModSys ;
with Sage ;


package body HelpLib is


procedure UserHelp (currentForm : in string;
currentRelation : in string;
currentField : in string;
fieldRepeat : in ModSys.S_natural;
occurenceNumber : in ModSys.S_natural) is

begin

-- The required USERHELP processing goes here
Display.DisplayForm ("HpDeptV", "", "", false);
Display.DisplayBackground (currentForm, false);
end UserHelp;

end HelpLib;

 


Go Back To Tutorial Table of Contents


warren.merrill@inl.gov , ftp://sage.inel.gov
Copyright © 1989-2006. Battelle Energy Alliance