# @BK

Exit key for browse lookup, msgbox and errorbox.

Browse Lookup - When defining a browse lookup, you can specify the keys that the user can press to exit. The key pressed by the user is captured in the system-maintained field "@BK" and can be acted upon to control processing. You will want to identify a processing label, when defining the browse lookup, and normally test for both valid and invalid keys pressed by the user.

Example:

You have an invoicing application and need to add new customers, update the customer's address and phone number, or simply view more customer detail than will fit on a browse line.

When defining the browse lookup, specify the valid exit keys "xkeys" to perform each of your desired options. You would probably use "A" to Add a customer, "U" to update, "V" to view. These exit keys will be shown as "xkey=AUV" when defining the browse.

If the user presses [A], when testing the value in @BK on a condition line, you might execute processing to check if a customer record already exists, and if NOT, popup a blank customer data-entry screen.

If the user presses [U], display a screen with limited update capability for changing just the address and phone numbers.

If the user presses [V], popup a "View Only" screen in the customer file.

If one of the three valid keys are not pressed, remove the browse and continue.

@BK and special keys such as ESC, Enter, Break Some special keys can be acted on just as any other key pressed by the user but you must use the key code that applies for the special keys e.g. [SAVE], [ENTR], [BRKY] and determine the special key pressed by checking the value of @sk. Refer to the Special Key Labels topic in this manual for a complete list of Special Key Labels.

MSGBOX and ERRORBOX - These processing commands let you display a message in a popup window on the screen. It will display a string "message" in a popup window at a designated position on the screen until the user presses ENTER or a key from a specified keylist. The key pressed by the user is captured in the system-maintained field "@BK" and can acted upon to control processing.