In character mode, if you abort to the operating system during application testing, or otherwise must abort from your production version, make sure your HLC application does not terminate with raw terminal I/O. Set the terminal to cooked terminal I/O before exiting. This prepares the terminal for UNIX operation, as shown in the following example:
/*
* Example of a fatal error exit for an HLC application.
*
* Note how the terminal is returned to cooked mode before
* exiting. Note also that exiting in this fashion can be
* hazardous to your database. (This function should only
* occur in program development phase for convenience in the
* debugging process.)
*/
Caution: An abnormal exit function might be useful during testing, but you should never include it in a production executable. Since it bypasses OpenEdge shutdown processing, this function can cause irrecoverable database damage.
OpenEdge automatically restores cooked-mode terminal I/O before exiting. If your application aborts in raw mode, the user can enter commands but might not see the result.
To reset a character-mode terminal in raw mode at a UNIX shell prompt:
1. Press CONTROL-J several times. Shell prompts appear on the display.
2. If the stty command on your version of UNIX has a sane option, enter the following command, followed by CONTROL-J:
stty sane
If your stty command does not have a sane option, enter the following command, followed by CONTROL-J: