Device Translation Tables

Device translation tables handle output to screens and printers. They map Uniface logical functions onto device functions, making it possible for Uniface to support a wide variety of hardware platforms, including their output devices.

Uniface uses a set of standard mnemonics, such as init, bold, clear_screen, formfeed, to represent logical device operations. A device translation table defines the control codes that the device uses to implement a particular operation. For example, a display device such as a VT200 uses the control code sequence ^esc[2J to clear the screen. When you define a device translation table, you map the mnemonic clear_screen to the control code sequence ^esc[2J.

Output Code Translation

Device translation tables translate logical device operations into device control
  codes.

Uniface makes no fundamental distinction between output devices of different types. Both printers and display terminals are defined using the same facility and the same mnemonic codes, but not all possibilities are used for both types of device. For example, a printer definition does not include a code for clear_screen and a terminal often does not have commands for linefeed.

For example, when a word should appear in bold, Uniface looks up the control codes associated with the logical function bold in the device table for the current display device. This occurs during the formatting of the data. Since each display device or printer requires a different set of codes, these would be provided in a different device translation tables.

Related Topics