ABSELECT

Determines the action bar choice and calls the appropriate dialog.

Type

Action bar function

Format

ABSELECT(handle ['expression'])
handle
The handle returned by ABCREATE.
expression
A string expression: the first character is the action bar mnemonic character, and the second and following characters are put in &SYSPARM. If expression is longer than 80 characters it is truncated with no warning.

Return Codes

0
ABSELECT completed successfully.
4
The cursor is not on a choice.
8
The presentation space is not available.
12
There is no match for the mnemonic.
16
The dialog call failed.

Usage Notes

  1. Use ABSELECT in the )EPILOGUE section.
  2. If handle is not correct, the dialog issuing ABSELECT fails.
  3. Call ABSELECT after the user presses the Enter key.
  4. An action bar item may be selected in these ways:
    • The user enters one or more characters in the mnemonic input area displayed by ABSHOW, if one was requested. The first character is checked against the mnemonics for the choices in the action bar; if there is a match the Dialog Manager calls the associated dialog and passes any remaining characters as "fastpath" data in &SYSPARM.
      • The user positions the cursor just before or on an item in the action bar displayed by ABSHOW. The associated dialog is invoked; there is no fastpath data.
      • A dialog issues ABSELECT with expression. expression is treated as if it had been entered in an action bar input area: the first character is the mnemonic choice and any remaining characters are passed as fastpath data in &SYSPARM.

      Refer to the Usage Notes® for ABCHOICE for information about how fastpath data is passed to the associated dialog.

  5. expression may be used to invoke a specific action bar item. For example, a dialog may provide two ways to exit: one through an action bar item (e.g., File/eXit) and another through a function key (e.g., F3). This code could be used to perform the same function for F3 as for File/eXit:
       if &SysKey = PF3 abselect(&AHandle 'FX')

Example

If the user has pressed Enter and the cursor is on the action bar (row 0), ABSELECT attempts to start the appropriate dialog, sending a message to the log if there is an error:


   if (&SysKey = 'ENTER') and (psmrow() = 0) do 
     set RC (abselect(&AHandle)) 

         if &RC = 8 log('No presentation space for ABSELECT') 
     else if &RC = 12 log('Invalid action bar mnemonic entered') 
     else if &RC = 16 log('ABSELECT could not run the dialog') 
   end

Note that return code 4 is not treated as an error.

See Also

ABCHOICE

ABCREATE