The DEVICES file contains an item for every terminal or printer device recognized by the mvBase System. The actual escape sequences produced by @ functions in BASIC and PROC are defined within these device drivers.
The item-IDs are device codes (for example, HP-LZRII is the HP-LZRIII terminal).
The attributes in the DEVICES file for printers are:
Attribute |
Name |
Description |
0 |
|
Full name and model number information for device. |
1 |
desc |
Description of device. |
2 |
points |
ASCII character for backspacing, number of columns, number of rows. |
3 |
lpi |
Device x-y cursor addressing statement, If applicable, will begins with ’=m’ otherwise the statement will contain a ’!’ (comment). |
4 |
lpp |
Cursor Addressing Code, if applicable, otherwise the statement will contain a ’!’ (comment). |
5 |
orient |
CRT Functions statement will begin with ’=s’,if applicable, otherwise the statement will contain a ’!’(comment). |
CRT Control Language (CCL)
D3 has a universal device function, the @() to specify certain printer commands.
To perform a certain feature the programmer will use the equivalent @() function. At runtime, the system will look up the function and substitute the proper character string then output it to the device. In this way, the compiled BASIC program does not have to contain hardware specific commands.
This method of device independence is achieved by creating many look-up tables - one for each device. Each look-up table contains over 300 different popular device functions, features and modes. Each function, referred to as an @() function has a corresponding character string which is output to the device. Such a look-up table is considered to be a "script" written in mvBase’s CRT Control Language or CCL.
Example Use of the @() function
The system inserts the default printer device from the DEVICES file into the user’s Printer Control Block (PCB).
When the users enters an ASSIGNFQ command which specifies a device in the DEVICES file, the system retrieves the device from the dictionary of DEVICES and overwrites the users PCB effectively changing the printer types.
Now when the user runs a BASIC program and prints to that device with an @ function, the system goes to the ’new’ PCB and finds the proper @ function and outputs a different data string.
A CCL script contains of several sections, each section contains sentences, each sentence contains data elements.
The specific information for creating a CCL script is contained in the CONTROL.LANGUAGE item in the DEVICES file. The information can be displayed by using:
COPY DEVICES CONTROL.LANGUAGE (T) |
See Also
Understanding the Print Spooler