Embed
Email

30

Document Sample

Shared by: cuiliqing
Categories
Tags
Stats
views:
0
posted:
10/28/2011
language:
English
pages:
4
Chapter 5





Session-Defining Procs









Login procs and menu procs are very useful when you want to isolate the user from the

current BASIS module. Because the user interacts with a menu that you create, the user is

not required to know syntax or commands. This chapter tells you how to set up session-

defining procs and gives some examples.









Login Procs

A login proc is a specialized proc that automatically executes when a user logs into the

system. Login procs can be used to automatically define user commands, set session

modes, begin a dialog with the user, and perform many other functions. There are two

levels of BASIS login procs:

 site login procs

 user login procs









Session-Defining Procs  75

Site Login Procs

BASIS attempts to locate and execute the site login proc each time a BASIS session is

started. By default, the site login proc is named:



Windows



%DM%\etc\dmlogin.prc



UNIX



$DM/etc/dmlogin.prc



VMS



DM$:DMLOGIN.PRC



This name can be changed at the time the BASIS system is generated for a site.



A site login proc must include the statement:



Windows, UNIX



@/IF_PRESENT !PROGRAM!log.prc UID='!UID!'



VMS



@/IF_PRESENT !PROGRAM!LOG.PRC UID='!UID!'



This command executes a user login proc if it is present. The name of the BASIS module

executed is substituted for “!PROGRAM!”. If an FQM session is started on VMS, the

site login proc attempts to locate and execute the user login proc, DMFQMLOG.PRC, in

the current directory. The user id is passed into the user login proc as the only parameter.









76  Session-Defining Procs

User Login Procs

These procs are set up for individual users. You can write your own as well as set them

up for other users. User login procs can contain any command that can be used in the

current module. Typical statements that go into a user login include:



Commands that establish default values:



SET/MODE

SET/DEFAULTS

SET/TYPE_OPTIONS

SET/PICTURE

SET/ROUTE

SET/LIBRARY



Abbreviations of commands:



SET/UC



Other legal BASIS commands:



FIND

TYPE

TELL



Other procs:



@MENU



Here is an example of a user login proc:

SET/GV START = $TIME

SET/UC EXIT=@EXIT

*

SET/UC TRACEFILE = SET/MODE TRACEFILE=

SET/UC TRACE = SET/MODE TRACE=YES

SET/UC NOTRACE = SET/MODE TRACE=NO

SET/UC ECHO = SET/MODE ECHOPROC=YES

SET/UC NOECHO = SET/MODE ECHOPROC=NO

*

SET/MODE CORRECT = NO

*

*

SET/UC FINDMGR = FIND E#EMPLOYEE.M#EMPLOYE WHERE +

E#EMPLOYEE.MGR_NO := M#EMPLOYEE.ENO AND E#EMPLOYEE.NAME=

*

SET/TYPE TABULAR = NO, LABEL = NO









Session-Defining Procs  77

*

SET/PIC EMPLOYEE.DNO:>4/NST>

SET/PIC EMPLOYEE.ENO:>5/NST>

*

@WELCOME

@REMINDER



It is possible to temporarily change a condition or statement that you set up in the user

login proc without changing the proc itself. To do this, you can set a command in a

session by using the SET/UC command and the new command overrides what is in the

user login proc. This new command only applies to your current session. When you log

in again, the commands you defined in your user login proc are again activated.









Executing a Menu Proc at the FQM Login

You can execute a menu proc at the FQM login by using the PROC parameter. This

parameter specifies the proc file to be executed immediately after the user login proc.

You can use this as an alternative to using the @ command followed by the proc name to

be executed within the login proc. The PROC parameter can be used to display a menu

that can govern an entire session after the login proc runs.



Here is how one might look. The following command can be put in the user’s login proc:

FQM, UID=xxxx,UPW=xxxx,DATABASE=xxxx,AIDS=NO, +



SS1

PROC=Host file descriptor for PROCMENU, MRT=NO



When the login proc for FQM finishes executing, the proc PROCMENU begins executing

as shown below.

The user model is open with UPDATE intent.

Good Morning. It is 7:55, June 11, 1995



How would you like to use the BASIS database today?



A. Find information about employees

B. Report of all employees in department number order

C. Report of all employees and their dependents

D. Report of all employees and their assignments

E. Leave BASIS





Enter your choice here >









78  Session-Defining Procs



Related docs
Other docs by cuiliqing
7 Recipes from Joe A.
Views: 0  |  Downloads: 0
Re-installingXPMode
Views: 0  |  Downloads: 0
telefonica_en
Views: 0  |  Downloads: 0
3220 Chap 6 demos
Views: 0  |  Downloads: 0
chap history.docx
Views: 1  |  Downloads: 0
Subcontractor Bid Form - The Fountains
Views: 0  |  Downloads: 0
English
Views: 0  |  Downloads: 0
DESIGNER'S SCHEDULE USE
Views: 0  |  Downloads: 0
Security Service Providers
Views: 44  |  Downloads: 0
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!