ABCREATE
Creates an action bar.
Type
Action bar function
Format
ABCREATE(maxchoices)- maxchoices
- The maximum number of choices displayed on the action bar.
Return Codes
- 0
- maxchoices was zero or negative.
- <>0
- ABCREATE completed successfully.
Usage Notes®
- Use ABCREATE in the dialog )INIT section.
- ABCREATE initializes an action bar block with enough space to hold the user-specified maximum number of action bar choices.
- ABCREATE returns a handle which is used on subsequent action bar functions.
- ABFREE must be used to release the action bar when it is no longer needed, otherwise a storage creep will occur. Action bars are not automatically freed.
Example
This is a skeleton of how the different action bar dialog functions are used within a dialog:
)init
set AHandle (abcreate(4))
abchoice(&AHandle 1 ...)
abchoice(&AHandle 2 ...)
abchoice(&AHandle 3 ...)
abchoice(&AHandle 4 ...)
)prolog
abshow(&AHandle ...)
)epilog
if &SysKey = 'ENTER' and (psmrow()) = 0 do
abselect(&AHandle)
...
end
)term
if &AHandle abfree(&ABHandle)
Heres what each ABxxxxxx function is doing:
- ABCREATE
- Allocates an action bar control block with space for 4 items.
- ABCHOICE
- Defines the action bar items.
- ABSHOW
- Displays the action bar items on the terminal.
- ABSELECT
- Checks if the user entered any action bar item.
- ABFREE
- Releases the action bar control block.