Progress
Results User’s Guide
for UNIX


Determining the Originating Module

Use the following shared variable in your Progress procedures to determine which Results module the user was in when they selected the User option. Use this information to return the user to the originating module or another module after running your add-on (User) module.

 DEFINE SHARED VARIABLE qbf-module AS CHARACTER NO-UNDO. 

The qbf-module variable holds one of the values listed in Table 10–1.

Table 10–1: Module Values 
Character
Meaning
?
The User module was selected from the Main Menu or a submenu.
q
The User module was selected from the Query module.
r
The User module was selected from the Reports module.
l
The User module was selected from the Labels module.
d
The User module was selected from the Data Export module.

If the User option is selected from a submenu (in any module), the value of qbf-module is a question mark (?), just as if it was chosen from the Main Menu.

Once the User module finishes processing, you can change the setting for qbf-module to return to another module. If you do not change the qbf-module value, the system automatically returns to the module where the user originally called the User option.

This code shows how you can use this feature in your program. This code puts the user in the customer form in the Query module if they selected the User program from the Main Menu.

/* This program places the user into the */
/* customer form from the sports database. */

IF qbf-module = ? THEN    /* called from the main menu */
ASSIGN
   qbf-module   = "q"
   qbf-file[1]  = "customer"
   qbf-db[2]    = "sports"
   qbf-where[1] = ""
   qbf-of[1]    = ""
   qbf-file[2]  = ""
   qbf-db[2]    = "".

RETURN. 

NOTE: Do not change the qbf-file shared variable contents set within the Query module when there is a query form already on the screen. Doing so can lead to unexpected results.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095