.topic Sommaire=0
 ADA HELP CONTENTSͻ
  {Attributes}            
  {Packages}              
 ͼ
  
.topic Index
 ADA HELP INDEX

 A
  {ACTION_CODE:PackageErrors}
  {ADDRESS}
  {AFT}
  {Attributes}
 B
  {BACKGROUND_COLOR:PackageCommon_Display_Types}
  {BASE}
  {BOX:PackageBox}
  {BYTE:PackageCommon_Display_Types}
 C
  {CALLABLE}
  {CLASS_CODE:PackageErrors}
  {CLEAR_SCREEN:ProcedureClear_Screen}
  {COLOR:PackageCommon_Display_Types}
  {COLOR_PALETTE:PackageCommon_Display_Types}
  {COLUMN_RANGE:PackageCommon_Display_Types}
  {COMMON_DISPLAY_TYPES:PackageCommon_Display_Types}
  {CONSTRAINED}
  {COUNT}
  {CURSOR:PackageCursor}
  {CURSOR_SIZE:PackageCommon_Display_Types}
 D
  {DELTA}
  {DIGITS}
  {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types}
  {DISPLAY_PAGE:PackageCommon_Display_Types}
  {DOWN:ProcedureDown}
  {DRAW:ProcedureDraw}
    {Using Default Boxes:DrawUsingDefaultBoxes}
    {Using a Selected Character:DrawUsingASelectedCharacter}
 E
  {EMAX}
  {EPSILON}
  {ERRORS:PackageErrors}
  {EXTENDED_ASCII:PackageCommon_Display_Types}
  {EXTENDED_ERRORS:PackageErrors}
 F
  {FIRST}
  {FIRST_BIT}
  {FORE}
 G
  {GET_EXTENDED_INFO:ProcedureGet_Extended_Info}
  {GET_LIGHT_PEN:ProcedureGet_Light_Pen}
  {GET_MODE:ProcedureGet_Mode}
  {GET_POSITION:ProcedureGet_Position}
  {GRAPHIC_COLOR:PackageCommon_Display_Types}
 I
  {IMAGE}
  {INHIBIT:ProcedureInhibit}
 L
  {LARGE}
  {LAST}
  {LAST_BIT}
  {LEFT:ProcedureLeft}
  {LENGTH}
  {LOCUS_CODE:PackageErrors}
 M
  {MACHINE_EMAX}
  {MACHINE_EMIN}
  {MACHINE_MANTISSA}
  {MACHINE_OVERFLOWS}
  {MACHINE_RADIX}
  {MACHINE_ROUNDS}
  {MANTISSA}
  {MOVE:ProcedureMove}
 P
  {Packages}
  {PART:TypePart}
  {PIXEL_VALUE:PackageVideo}
  {POS}
  {POSITION}
  {PRED}
 R
  {RANGE}
  {READ_CHAR:ProcedureRead_Char}
  {READ_PIXEL:FunctionRead_Pixel}
  {RIGHT:ProcedureRight}
  {ROW_RANGE:PackageCommon_Display_Types}
 S
  {SAFE_EMAX}
  {SAFE_LARGE}
  {SAFE_SMALL}
  {SCROLL_DOWN:ProcedureScroll_Down}
  {SCROLL_UP:ProcedureScroll_Up}
  {SET:ProcedureSet}
  {SET_ACTIVE:ProcedureSet_Active}
  {SET_COLOR_PALETTE:ProcedureSet_Color_Palette}
    {Text or Graphics:TextOrGraphics}
    {CGA}
  {SET_SIZE:ProcedureSet_Size}
  {SIMPLE_KIND:TypeSimple_Kind}
  {SIZE}
  {SMALL}
  {STORAGE_SIZE}
  {SUCC}
 T
  {TERMINATED}
 U
  {UNDERLINE:PackageCommon_Display_Types}
  {UP:ProcedureUp}
  {USER_DEFINITION:TypeUser_Definition}
 V
  {VAL}
  {VALUE}
  {VIDEO_MODE:TypeVideo_Mode}
 W
  {WIDTH}
  {WRITE_CHAR:ProcedureWrite_Char}
    {Write With Attributes:WriteWithAttributes}
    {Write With Previous Attributes:WriteWithPreviousAttributes}
  {WRITE_GRAPHIC_CHAR:ProcedureWrite_Graphic_Char}
  {WRITE_PIXEL:ProcedureWrite_Pixel}
  {WRITE_TTY:ProcedureWrite_Tty}
    {Write To Current Display Page:WriteToCurrentDisplayPage}
    {Write Graphic Character:WriteGraphicCharacter}
.topic Packages
 PACKAGES 
 
 {Package BOX:PackageBox}
 {Package COMMON_DISPLAY_TYPES:PackageCommon_Display_Types}
 {Package CURSOR:PackageCursor}
 {Package ERRORS:PackageErrors}
 {Package VIDEO:PackageVideo}
.topic PackageBox
 PACKAGE BOX 
 
The package BOX provides procedures for drawing boxes on the text screen
either using the box-drawing characters (tops, bottoms, sides, and corners)
or using a single selected character.

The routines in package BOX call many DOS functions; there is no
correspondence to a single DOS function as with most of the other subprograms
in the Meridian Ada DOS Environment Library.

SPECIFICATION:

   with {COMMON_DISPLAY_TYPES:PackageCommon_Display_Types};
   use  COMMON_DISPLAY_TYPES;
   
   package BOX is
   
      type {PART:TypePart} is (
         NORTH, NORTHEAST, EAST, SOUTHEAST,
         SOUTH, SOUTHWEST, WEST, NORTHWEST
      );
      
      type {USER_DEFINITION:TypeUser_Definition} is array({PART:TypePart}) of {EXTENDED_ASCII:PackageCommon_Display_Types};
      
      type {SIMPLE_KIND:TypeSimple_Kind} is (
         SINGLE_SIDED, DOUBLE_SIDED,
         SINGLE_TOP,   DOUBLE_TOP
      );
      
      procedure {DRAW:DrawUsingDefaultBoxes}(
         UPPER_LEFT_ROW     : {ROW_RANGE:PackageCommon_Display_Types};
         UPPER_LEFT_COLUMN  : {COLUMN_RANGE:PackageCommon_Display_Types};
         LOWER_RIGHT_ROW    : ROW_RANGE;
         LOWER_RIGHT_COLUMN : COLUMN_RANGE;
         KIND               : SIMPLE_KIND := SINGLE_SIDED;
         ATTRIBUTE          : {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types} := (
            FOREGROUND => {WHITE:PackageCommon_Display_Types},
            BACKGROUND => BLACK,
            BLINK      => FALSE
         );
         PAGE               : {DISPLAY_PAGE:PackageCommon_Display_Types}      := 0
      );
      
      procedure {DRAW:DrawUsingASelectedCharacter}(
         UPPER_LEFT_ROW     : ROW_RANGE;
         UPPER_LEFT_COLUMN  : COLUMN_RANGE;
         LOWER_RIGHT_ROW    : ROW_RANGE;
         LOWER_RIGHT_COLUMN : COLUMN_RANGE;
         BOX_DEFINITION     : {USER_DEFINITION:TypeUser_Definition};
         ATTRIBUTE          : DISPLAY_ATTRIBUTE := (
            FOREGROUND => WHITE,
            BACKGROUND => BLACK,
            BLINK      => FALSE
         );
         PAGE               : DISPLAY_PAGE      := 0
      );
      
   end BOX;
   
.topic TypePart
 TYPE PART  (package {BOX:PackageBox}) 
 
Type PART is an enumeration used to describe the parts of a box.

   type PART is (
      NORTH, NORTHEAST, EAST, SOUTHEAST,
      SOUTH, SOUTHWEST, WEST, NORTHWEST
   );
      
The elements are compass points and have these correspondences:

   North      The top of a box
   NorthEast  The upper right corner of a box
   East       The right side of a box
   SouthEast  The lower right corner of a box
   South      The bottom of a box
   SouthWest  The lower left corner of a box
   West       The left side of a box
   NorthWest  The upper left corner of a box
   
These are illustrated as:

                           North
   NorthWest Ŀ NorthEast
                                           
                                           
        West                                East
                                           
                                           
   SouthWest  SouthEast
                           South
.topic TypeUser_Definition
 TYPE USER_DEFINITION (package {BOX:PackageBox}) 
 
Type USER_DEFINITION is used to describe what character is used for each
part of a box.

   type USER_DEFINITION is array({PART:TypePart}) of {EXTENDED_ASCII:PackageCommon_Display_Types};
      
Some particularly useful characters for drawing boxes are in the range
179..218. If no table showing these characters is available, then the
following program will print them out:

   with {VIDEO:PackageVideo};
   
   procedure PRINTCHARS is
   begin
      for CHAR in 179..218 loop
         VIDEO.WRITE_TTY(CHAR); -- write to page 0
         VIDEO.WRITE_TTY(' ');  -- separate with space
      end loop;
   end PRINTCHARS;
.topic TypeSimple_Kind
 TYPE SIMPLE_KIND  (package {BOX:PackageBox}) 
 
Type SIMPLE_KIND is used to select a pre-defined box style.

   type SIMPLE_KIND is (
      SINGLE_SIDED, DOUBLE_SIDED,
      SINGLE_TOP,   DOUBLE_TOP
   );
      
The default box drawing characters are the IBM PC characters used to draw
connecting horizontal and vertical lines and corners, with either single
rules or double rules.

The box styles corresponding to each SIMPLE_KIND are:

   Single_Sided  single-rule lines all around
   Double_Sided  double-rule lines all around
   Single_Top    single-rule lines on top and bottom;
                 double rule lines on the sides
   Double_Top    double-rule lines on top and bottom;
                 single-rule lines on the sides
.topic ProcedureDraw
 PROCEDURE DRAW  (package {BOX:PackageBox}) 
 
There are two overloaded versions of procedure DRAW, the disambiguating
parameter being KIND or BOX_DEFINITION. The first version draws a few kinds
of boxes using default box-drawing characters, the second version uses
selected characters for each part of a box.

See:
   {Using Default Boxes:DrawUsingDefaultBoxes}
   {Using a Selected Character:DrawUsingASelectedCharacter}
.topic DrawUsingDefaultBoxes
 PROCEDURE DRAW  (package {BOX:PackageBox}) 
 
 Using Default Boxes
 
The first version of procedure DRAW displays one of several pre-defined box
types using default box-drawing characters.

   procedure DRAW(
      UPPER_LEFT_ROW     : {ROW_RANGE:PackageCommon_Display_Types};
      UPPER_LEFT_COLUMN  : {COLUMN_RANGE:PackageCommon_Display_Types};
      LOWER_RIGHT_ROW    : ROW_RANGE;
      LOWER_RIGHT_COLUMN : COLUMN_RANGE;
      KIND               : SIMPLE_KIND := SINGLE_SIDED;
      ATTRIBUTE          : {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types} := (
         FOREGROUND => {WHITE:PackageCommon_Display_Types},
         BACKGROUND => BLACK,
         BLINK      => FALSE
      );
      PAGE               : {DISPLAY_PAGE:PackageCommon_Display_Types}      := 0
   );

Given the upper left and lower right coordinates, a box is drawn on the
specified display page with the specified style and attributes.

This call is valid for text modes only.

Invalid coordinates or attempting to exceed the current mode's display size
has unpredictable results.

An example for drawing a single-sided box follows.

   -- draw a single-sided box at (row/col)
   --
   --     5,5-----------5,20
   --      |             |
   --      |             |
   --    10,5----------10,20
   --
   -- in page zero, with White/Black blinking attributes.
   --
   with {COMMON_DISPLAY_TYPES:PackageCommon_Display_Types}, {BOX:PackageBox};
   use COMMON_DISPLAY_TYPES;
   
   procedure BOX_TEST1 is
      ATTR: {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types};
   begin
      ATTR.BLINK := TRUE;
      BOX.DRAW(
         UPPER_LEFT_ROW     => 5,
         UPPER_LEFT_COLUMN  => 5,
         LOWER_RIGHT_ROW    => 10,
         LOWER_RIGHT_COLUMN => 20,
         ATTRIBUTE          => ATTR
      );
   end;
.topic DrawUsingASelectedCharacter
 PROCEDURE DRAW  (package {BOX:PackageBox}) 
 
 Using a Selected Character
 
The second version of procedure DRAW uses a selected character to draw each
box part.

   procedure DRAW(
      UPPER_LEFT_ROW     : {ROW_RANGE:PackageCommon_Display_Types};
      UPPER_LEFT_COLUMN  : {COLUMN_RANGE:PackageCommon_Display_Types};
      LOWER_RIGHT_ROW    : ROW_RANGE;
      LOWER_RIGHT_COLUMN : COLUMN_RANGE;
      BOX_DEFINITION     : {USER_DEFINITION:TypeUser_Definition};
      ATTRIBUTE          : {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types} := (
         FOREGROUND => {WHITE:PackageCommon_Display_Types},
         BACKGROUND => BLACK,
         BLINK      => FALSE
      );
      PAGE               : {DISPLAY_PAGE:PackageCommon_Display_Types}      := 0
   );
      
Given the upper left and lower right coordinated, a box is drawn with the
specified character and attributes in the specified display page.

This call is valid for text modes only.

Invalid coordinates or attempting to exceed the current mode's display size
has unpredictable results.

An example of procedure DRAW using a selected character follows.

   -- draw a box with the Happy Face character at (row/col)
   --
   --      5,5-----------5,30
   --       |             |
   --       |             |
   --      7,5-----------7,30
   --
   -- in page zero, with Cyan/Black attributes.
   --
   with {COMMON_DISPLAY_TYPES:PackageCommon_Display_Types}, {BOX:PackageBox};
   use  COMMON_DISPLAY_TYPES;
   
   procedure BOX_TEST2 is
      ATTR: {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types};
      MY_BOX: {BOX.USER_DEFINITION:TypeUser_Definition} := (others => 1);
         -- 1 = Happy Face
   begin
      ATTR.FOREGROUND := CYAN;
      BOX.DRAW(
         UPPER_LEFT_ROW     => 5,
         UPPER_LEFT_COLUMN  => 5,
         LOWER_RIGHT_ROW    => 7,
         LOWER_RIGHT_COLUMN => 30,
         BOX_DEFINITION     => MY_BOX,
         ATTRIBUTE          => ATTR
      );
   end;

Note that a different box-drawing character fromt the IBM PC character set
may be used for each part.
.topic PackageCommon_Display_Types
 PACKAGE COMMON_DISPLAY_TYPES 
 
The package COMMON_DISPLAY_TYPES contains type declarations for the various
packages that handle display operations: {BOX:PackageBox},
{CURSOR:PackageCursor}, TTY, and {VIDEO:PackageVideo}.

SPECIFICATION:

   package COMMON_DISPLAY_TYPES is
   
      subtype BYTE is INTEGER range 0..255;
      
      subtype EXTENDED_ASCII is INTEGER range 0..255;
      
      subtype COLUMN_RANGE is INTEGER range 0..79;
      subtype ROW_RANGE    is INTEGER range 0..24;
      
      subtype CURSOR_SIZE is INTEGER range 0..13;
      
      subtype DISPLAY_PAGE is INTEGER range 0..7;
      
      type COLOR is (
         BLACK,        BLUE,          GREEN,
         CYAN,         RED,           MAGENTA,
         BROWN,        WHITE,         GREY,
         LIGHT_BLUE,   LIGHT_GREEN,   LIGHT_CYAN,
         LIGHT_RED,    LIGHT_MAGENTA, YELLOW,
         BRIGHT_WHITE
      );
      
      subtype BACKGROUND_COLOR is COLOR range BLACK..WHITE;
      
      type DISPLAY_ATTRIBUTE is
         record
            FOREGROUND: COLOR            := WHITE;
            BACKGROUND: BACKGROUND_COLOR := BLACK;
            BLINK     : BOOLEAN          := FALSE;
         end record;
      
      --
      -- underline valid for monochrome mode only.
      --
      UNDERLINE: constant DISPLAY_ATTRIBUTE := (
         FOREGROUND => BLUE,
         BACKGROUND => BLACK,
         BLINK      => FALSE
      );
      
      subtype COLOR_PALETTE is INTEGER range 0..1;
      type GRAPHIC_COLOR is (
         BACKGROUND, COLOR1,
         COLOR2,     COLOR3
      );
   
   end COMMON_DISPLAY_TYPES;
.topic PackageCursor
 PACKAGE CURSOR 
 
Package CURSOR provides operations to move a text mode cursor, to get the
current cursor coordinates, and to alter the visibility or form of the
cursor.

The Color/Graphics Adapter has height display pages (0..7) in 40 column by
25 line text modes and four display pages in the 80 column by 25 line text
modes. The Monochrome adapter has only one display page. Specifying an
invalid display page (i.e. a display page that is not defined for the current
text display mode) has unpredictable results.

SPECIFICATION:

   with {COMMON_DISPLAY_TYPES:PackageCommon_Display_Types};
   use  COMMON_DISPLAY_TYPES;
   
   package CURSOR is
   
      procedure {SET_SIZE:ProcedureSet_Size}(
         START_LINE: {CURSOR_SIZE:PackageCommon_Display_Types};
         END_LINE  : CURSOR_SIZE
      );
      
      procedure {INHIBIT:ProcedureInhibit};
      
      procedure {MOVE:ProcedureMove}(
         ROW   : {ROW_RANGE:PackageCommon_Display_Types};
         COLUMN: {COLUMN_RANGE:PackageCommon_Display_Types};
         PAGE  : {DISPLAY_PAGE:PackageCommon_Display_Types} := 0
      );
      
      procedure {GET_POSITION:ProcedureGet_Position}(
         ROW   : out ROW_RANGE;
         COLUMN: out COLUMN_RANGE;
         PAGE  : DISPLAY_PAGE := 0
      );
      
      procedure {UP:ProcedureUp}   (PAGE: DISPLAY_PAGE := 0);
      procedure {DOWN:ProcedureDown} (PAGE: DISPLAY_PAGE := 0);
      procedure {LEFT:ProcedureLeft} (PAGE: DISPLAY_PAGE := 0);
      procedure {RIGHT:ProcedureRight}(PAGE: DISPLAY_PAGE := 0);
      
   end CURSOR;
.topic ProcedureSet_Size
 PROCEDURE SET_SIZE  (package {CURSOR:PackageCursor}) 
 
Procedure SET_SIZE sets the START_LINE and END_LINE of the blinking cursor.

   procedure SET_SIZE(
      START_LINE: {CURSOR_SIZE:PackageCommon_Display_Types};
      END_LINE  : CURSOR_SIZE
   );

This call is valid only in Text modes.

The ROM BIOS default values for START_LINE and END_LINE are:
 Ŀ
  TEXT DISPLAY MODE      START_LINE  END_LINE 
 Ĵ
  Text80_BW_Ma (Mode 7)      11         12    
  Text40_BW    (Mode 0)       6          7    
  Text40_CO    (Mode 1)       6          7    
  Text80_BW    (Mode 2)       6          7    
  Text80_CO    (Mode 3)       6          7    
 
A particular text display mode is selectable via the procedure VIDEO.SET.
Refer to {package VIDEO:PackageVideo} for a description of the various text
modes.

This call corresponds to Interrupt 16#10#, function 16#01#.
.topic ProcedureInhibit
 PROCEDURE INHIBIT  (package {CURSOR:PackageCursor}) 
 
Procedure INHIBIT inhibits display of the cursor (i.e. makes it invisible).

   procedure INHIBIT;
   
This call is valid only in Text modes.

This call corresponds to Interrupt 16#10#, function 16#01#.
.topic ProcedureMove
 PROCEDURE MOVE  (package {CURSOR:PackageCursor}) 
 
Procedure MOVE moves the cursor to the specified ROW and COLUMN within the
specified display PAGE.

   procedure MOVE(
      ROW   : {ROW_RANGE:PackageCommon_Display_Types};
      COLUMN: {COLUMN_RANGE:PackageCommon_Display_Types};
      PAGE  : {DISPLAY_PAGE:PackageCommon_Display_Types} := 0
   );
   
Moving the cursor to a location that is invalid for the current display mode
has unpredictable results.

The coordinate scheme is rectangular:
 (0,0)    Coordinate (Row 0, Column 0) is the
          upper left corner of the display.
 (24,79)  Coordinate (Row 24, Column 79) is the
          lower right corner of the display in
          80-column text modes.

This call corresponds to Interrupt 16#10#, function 16#02#.

An example follows:

   -- Move the cursor to row 10, column 20 in display page
   -- 0 (default page).
   --
   CURSOR.MOVE(ROW => 10, COLUMN => 20);
.topic ProcedureGet_Position
 PROCEDURE GET_POSITION  (package {CURSOR:PackageCursor}) 
 
Procedure GET_POSITION returns the current cursor position for the specified
display page.

   procedure GET_POSITION(
      ROW   : out {ROW_RANGE:PackageCommon_Display_Types};
      COLUMN: out {COLUMN_RANGE:PackageCommon_Display_Types};
      PAGE  : {DISPLAY_PAGE:PackageCommon_Display_Types} := 0
   );
      
This call corresponds to Interrupt 16#10#, function 16#03#.

An example follows:

   -- Get the current cursor position of display page 1
   --
   CURSOR.GET_POSITION(
      ROW    => PAGE1_ROW,
      COLUMN => PAGE1_COL,
      PAGE   => 1
   );
.topic ProcedureUp
 PROCEDURE UP  (package {CURSOR:PackageCursor}) 
 
Procedure UP moves the cursor up one location in the specified display page.

   procedure UP(PAGE: {DISPLAY_PAGE:PackageCommon_Display_Types} := 0);
   
Attempts to move the cursor up past the top of the screen are ignored.

This call corresponds to Interrupt 16#10#, function 16#02#.

An example follows:

   -- Move the display page zero cursor up one location.
   --
   CURSOR.UP;
.topic ProcedureDown
 PROCEDURE DOWN  (package {CURSOR:PackageCursor}) 
 
Procedure DOWN moves the cursor down one location in the specified display
page.

   procedure DOWN(PAGE: {DISPLAY_PAGE:PackageCommon_Display_Types} := 0);
   
Attempts to move the cursor down past the bottom of the screen are ignored.

This call corresponds to Interrupt 16#10#, function 16#02#.

An example follows:

   -- Move the display page zero cursor down one location.
   --
   CURSOR.DOWN;
.topic ProcedureLeft
 PROCEDURE LEFT  (package {CURSOR:PackageCursor}) 
 
Procedure LEFT moves the cursor left one location in the specified display
page.

   procedure LEFT(PAGE: {DISPLAY_PAGE:PackageCommon_Display_Types} := 0);
   
Attempts to move the cursor left past the edge of the screen are ignored.

This call corresponds to Interrupt 16#10#, function 16#02#.

.topic ProcedureRight
 PROCEDURE RIGHT  (package {CURSOR:PackageCursor}) 
 
Procedure RIGHT moves the cursor right one location in the specified display
page.

   procedure RIGHT(PAGE: {DISPLAY_PAGE:PackageCommon_Display_Types} := 0);
   
Attempts to move the cursor past the right edge of the screen are ignored.

This call corresponds to Interrupt 16#10#, function 16#02#.
.topic PackageErrors
 PACKAGE ERRORS 
 
Package ERRORS provides PC-DOS status declarations and for version 3.0 or
later of PC-DOS, a procedure to get extended status information.

SPECIFICATION:

   package ERRORS is
   
      type EXTENDED_ERRORS is (
         OK,
         INVALID_FUNCTION,
         FILE_NOT_FOUND,
         PATH_NOT_FOUND,
         NO_HANDLE_AVAILABLE,
         ACCESS_DENIED,
         INVALID_HANDLE,
         MEMORY_BLOCKS_DESTROYED,
         INSUFFICIENT_MEMORY,
         INVALID_MEMORY_BLOCK,
         INVALID_ENVIRONMENT,
         INVALID_FORMAT,
         INVALID_FILE_ACCESS,
         INVALID_DATA,
         RESERVED14,
         INVALID_DRIVE,
         REMOVE_CURRENT_DIRECTORY,
         NOT_SAME_DEVICE,
         NO_MORE_FILES,
         DISK_WRITE_PROTECTED,
         UNKNOWN_UNIT,
         DRIVE_NOT_READY,
         COMMAND_NOT_DEFINED,
         DISK_DATA_ERROR,
         BAD_STRUCTURE_LENGTH,
         SEEK_ERROR,
         UNKNWON_MEDIA_TYPE,
         SECTOR_NOT_FOUND,
         PRINTER_OUTOF_PAPER,
         WRITE_ERROR,
         READ_ERROR,
         GENERAL_FAILURE,
         FILE_SHARING_VIOLATION,
         FILE_LOCKING_VIOLATION,
         INVALID_DISK_CHANGE,
         NO_FCB_AVAILABLE,
         FILE_ALREADY_EXISTS,
         RESERVED81,
         CANNOT_MAKE,
         INTERRUPT_FAILURE,
         UNKNOWN_ERROR
      );
      
      type CLASS_CODE is (
         OUT_OF_RESOURCE,   TEMPORARY_SITUATION,
         AUTHORIZATION,     INTERNAL_DOS_ERROR,
         HARDWARE_FAILURE,  SYSTEM_SW_ERROR,
         APPLICATION_ERROR, NOT_FOUND,
         BAD_FORMAT,        ITEM_LOCKED,
         MEDIA_ERROR,       ALREADY_EXISTS,
         UNKNOWN
      );
      
      type ACTION_CODE is (
         TRY_AGAIN,           TRY_AGAIN_LATER,
         USER_TO_FIX,         SHUT_DOWN_PROGRAM,
         SHUT_DOWN_IMMEDIATE, IGNORE_ERROR,
         RETRY_AFTER_FIX,     UNKNOWN
      );
      
      type LOCUS_CODE is (
         UNKNOWN,         BLOCK_DEVICE,
         NETWORK_RELATED, SERIAL_DEVICE,
         MEMORY_RELATED
      );
      
      -- DOS 3.0 procedure
      procedure {GET_EXTENDED_INFO:ProcedureGet_Extended_Info}(
         ERROR : out EXTENDED_ERRORS;
         CLASS : out CLASS_CODE;
         ACTION: out ACTION_CODE;
         LOCUS : out LOCUS_CODE
      );
   
   end ERRORS;
.topic ProcedureGet_Extended_Info
 PROCEDURE GET_EXTENDED_INFO  (package {ERRORS:PackageErrors}) 
 
Procedure GET_EXTENDED_INFO obtains detailed information after a previously
unsuccessful system call. The information may suggest action that the program
should take.

   procedure GET_EXTENDED_INFO(
      ERROR : out {EXTENDED_ERRORS:PackageErrors};
      CLASS : out {CLASS_CODE:PackageErrors};
      ACTION: out {ACTION_CODE:PackageErrors};
      LOCUS : out {LOCUS_CODE:PackageErrors}
   );

This function requires DOS 3.0 or higher. Execution of this function with a
lower revision causes the exception REVISION.INCORRECT_DOS_VERSION to be
raised.

This call corresponds to Interrupt 16#21#, function 16#59#.

An example follows:

   with ERRORS, DIRECTORY;
   use  ERRORS;
   
   procedure ERRORS_TEST1 is
      MAKE_ERROR: EXTENDED_ERRORS;
      ERROR     : EXTENDED_ERRORS;
      CLASS     : CLASS_CODE;
      ACTION    : ACTION_CODE;
      LOCUS     : LOCUS_CODE;
   begin
      MAKE_ERROR := DIRECTORY.MAKE(NAME => "A:\Junk");
      if MAKE_ERROR /= OK then
         GET_EXTENDED_INFO(ERROR, CLASS, ACTION, LOCUS);
      end if;
   end;
.topic PackageVideo
 PACKAGE VIDEO 
 
Package VIDEO provides various output and control functions for the
Monochrome, Color Graphics, and Extended Graphics Adapter Cards.

The Color/Graphics Adapter has eight display pages (0..7) in 40 column by
25 line text modes and four display pages in the 80 column by 25 line text
modes. The Monochrome adapter has only one display page. Specifying an
invalid display page (i.e. a display page that is not defined for the current
text display mode) has unpredictable results.

Some of the overloaded subprograms are disambiguated by the type of character
that they accept: either STANDARD.CHARACTER or
{COMMON_DISPLAY_TYPES.EXTENDED_ASCII:PackageCommon_Display_Types}. Be aware
that the Ada pre-defined type CHARACTER supports only seven-bit ASCII
characters. If it is necessary to manipulate all eight bits of a byte, then
pragma SUPPRESS should be used when using objects of type CHARACTER (to avoid
the exception CONSTRAINT_ERROR), or the type EXTENDED_ASCII should be used.

SPECIFICATION:

   with {COMMON_DISPLAY_TYPES:PackageCommon_Display_Types};
   use  COMMON_DISPLAY_TYPES;
   
   package VIDEO is
   
      type {VIDEO_MODE:TypeVideo_Mode} is (
         TEXT40_BW,
         TEXT40_CO,
         TEXT80_BW,
         TEXT80_CO,
         GRAPHIC_4_COLOR,
         GRAPHIC_4_GREY,
         GRAPHIC_BW,
         TEXT80_BW_MA,
         GRAPHIC_COLOR_HIGH,
         GRAPHIC_MED_EGA,
         GRAPHIC_HIGH_EGA,
         GRAPHIC_EXTRA_EGA,
         COLOR_EXTRA_EGA
      );
      
      type PIXEL_VALUE is
         record
            XOR_BIT    : BOOLEAN       := FALSE;
            PIXEL_COLOR: {GRAPHIC_COLOR:PackageCommon_Display_Types} := {BACKGROUND:PackageCommon_Display_Types};
         end record;
      
      procedure {SET:ProcedureSet}(MODE: VIDEO_MODE);
      
      procedure {GET_MODE:ProcedureGet_Mode}(
         WIDTH: out {BYTE:PackageCommon_Display_Types};
         MODE : out VIDEO_MODE;
         PAGE : out {DISPLAY_PAGE:PackageCommon_Display_Types}
      );
      
      procedure {GET_LIGHT_PEN:ProcedureGet_Light_Pen}(
         TRIGGERED: out BOOLEAN;
         PIXEL_ROW: out INTEGER;
         PIXEL_COL: out INTEGER;
         CHAR_ROW : out INTEGER;
         CHAR_COL : out INTEGER
      );
      
      procedure {SET_ACTIVE:ProcedureSet_Active}(PAGE: DISPLAY_PAGE);
      
      --
      -- Windowing functions
      --
      procedure {SCROLL_UP:ProcedureScroll_Up}(
         NUMBER_OF_LINES : BYTE;
         UPPER_ROW       : {ROW_RANGE:PackageCommon_Display_Types};
         LEFT_COLUMN     : {COLUMN_RANGE:PackageCommon_Display_Types};
         LOWER_ROW       : ROW_RANGE;
         RIGHT_COLUMN    : COLUMN_RANGE;
         FILLER_ATTRIBUTE: {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types} := (
            FOREGROUND => WHITE;
            BACKGROUND => BLACK;
            BLINK      => FALSE
         )
      );
      
      procedure {SCROLL_DOWN:ProcedureScroll_Down}(
         UPPER_ROW       : ROW_RANGE;
         LEFT_COLUMN     : COLUMN_RANGE;
         LOWER_ROW       : ROW_RANGE;
         RIGHT_COLUMN    : COLUMN_RANGE;
         FILLER_ATTRIBUTE: {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types} := (
            FOREGROUND => WHITE;
            BACKGROUND => BLACK;
            BLINK      => FALSE
         )
      );
      
      procedure {CLEAR_SCREEN:ProcedureClear_Screen};
      
      procedure {READ_CHAR:ProcedureRead_Char}(
         ITEM     : out EXTENDED_ASCII;
         ATTRIBUTE: out DISPLAY_ATTRIBUTE;
         PAGE     : DISPLAY_PAGE := 0
      );
      
      procedure {WRITE_CHAR:WriteWithAttributes}(
         ITEM        : CHARACTER;
         REPEAT_COUNT: NATURAL;
         ATTRIBUTE   : DISPLAY_ATTRIBUTE := (
            FOREGROUND => WHITE;
            BACKGROUND => BLACK;
            BLINK      => FALSE
         )
      );
      
      procedure {WRITE_CHAR:WriteWithAttributes}(
         ITEM        : EXTENDED_ASCII;
         REPEAT_COUNT: NATURAL;
         ATTRIBUTE   : DISPLAY_ATTRIBUTE := (
            FOREGROUND => WHITE;
            BACKGROUND => BLACK;
            BLINK      => FALSE
         )
      );
      
      procedure {WRITE_CHAR:WriteWithPreviousAttributes}(
         ITEM        : CHARACTER;
         REPEAT_COUNT: NATURAL;
         PAGE        : DISPLAY_PAGE
      );
      
      procedure {WRITE_CHAR:WriteWithPreviousAttributes}(
         ITEM        : EXTENDED_ASCII;
         REPEAT_COUNT: NATURAL;
         PAGE        : DISPLAY_PAGE
      );
      
      procedure {SET_COLOR_PALETTE:TextOrGraphics}(TO_COLOR: {COLOR:PackageCommon_Display_Types});
      
      procedure {WRITE_TTY:WriteToCurrentDisplayPage}(ITEM: CHARACTER);
      
      procedure {WRITE_TTY:WriteToCurrentDisplayPage}(ITEM: EXTENDED_ASCII);
      
      --
      -- Graphics Mode Only
      --
      procedure {SET_COLOR_PALETTE:CGA}(
         TO_PALETTE: {COLOR_PALETTE:PackageCommon_Display_Types};
      );
      
      procedure {WRITE_TTY:WriteGraphicCharacter}(
         ITEM       : CHARACTER;
         WHICH_COLOR: PIXEL_VALUE
      );
      
      procedure {WRITE_PIXEL:ProcedureWrite_Pixel}(
         PIXEL_COLOR : PIXEL_VALUE;
         PIXEL_ROW   : NATURAL;
         PIXEL_COLUMN: NATURAL
      );
      
      function {READ_PIXEL:FunctionRead_Pixel}(
         PIXEL_ROW   : NATURAL;
         PIXEL_COLUMN: NATURAL
      )  return PIXEL_VALUE;
      
      procedure {WRITE_GRAPHIC_CHAR:ProcedureWrite_Graphic_Char}(
         ITEM        : CHARACTER;
         ATTRIBUTE   : PIXEL_VALUE;
         REPEAT_COUNT: NATURAL
      );
      
   end VIDEO;
.topic TypeVideo_Mode
 TYPE VIDEO_MODE  (package {VIDEO:PackageVideo}) 
 
 Ŀ
  VIDEO_MODE          Mode #  Description                 
 Ĵ
  TEXT40_BW             00H   25x40 B/W text, Color       
                                Graphics Adapter (CGA)    
  TEXT40_CO             01H   25x40 Color text (CGA)      
  TEXT80_BW             02H   25x80 B/W text (CGA)        
  TEXT80_CO             03H   25x80 Color text (CGA)      
  GRAPHIC_4_COLOR       04H   200x320 4 color graphics    
                                (CGA)                     
  GRAPHIC_4_GREY        05H   200x320 4 grey (CGA)        
  GRAPHIC_BW            06H   200x640 2 color (CGA)       
  TEXT80_BW_MA          07H   25x80 B/W text, Monochrome  
                                adapter (EGA)             
  GRAPHIC_COLOR_HIGH    0AH   200x640 color graphics,     
                                Extended Adapter (EGA)    
  GRAPHIC_MED_EGA       0DH   200x320 16 color graphics   
                                (EGA)                     
  GRAPHIC_HIGH_EGA      0EH   200x640 16 color graphics   
                                (EGA)                     
  GRAPHIC_EXTRA_EGA     0FH   350x640 monochrome graphics 
                                (EGA)                     
  COLOR_EXTRA_EGA       10H   350x640 four color or       
                                16-color graphics (EGA)   
 
.topic ProcedureSet
 PROCEDURE SET  (package {VIDEO:PackageVideo}) 
 
Procedure SET sets the current video display mode.

   procedure SET(MODE: {VIDEO_MODE:TypeVideo_Mode});
   
This call corresponds to Interrupt 16#10#, function 16#00#.

An example follows:

   -- set the video mode to 25x40 color text.
   --
   VIDEO.SET(MODE => TEXT40_CO);
.topic ProcedureGet_Mode
 PROCEDURE GET_MODE  (package {VIDEO:PackageVideo}) 
 
Procedure GET_MODE obtains the current display mode, screen width, and page.

   procedure GET_MODE(
      WIDTH: out {BYTE:PackageCommon_Display_Types};
      MODE : out {VIDEO_MODE:TypeVideo_Mode};
      PAGE : out {DISPLAY_PAGE:PackageCommon_Display_Types}
   );
   
This call corresponds to Interrupt 16#10#, function 16#0F#.
.topic ProcedureGet_Light_Pen
 PROCEDURE GET_LIGHT_PEN  (package {VIDEO:PackageVideo}) 
 
Procedure GET_LIGHT_PEN obtains the light pen's current status and position.

   procedure GET_LIGHT_PEN(
      TRIGGERED: out BOOLEAN;
      PIXEL_ROW: out INTEGER;
      PIXEL_COL: out INTEGER;
      CHAR_ROX : out INTEGER;
      CHAR_COL : out INTEGER
   );
   
This call corresponds to Interrupt 16#10#, function 16#04#.
.topic ProcedureSet_Active
 PROCEDURE SET_ACTIVE  (package {VIDEO:PackageVideo}) 
 
Procedure SET_ACTIVE sets the active video display page.

   procedure SET_ACTIVE(PAGE: {DISPLAY_PAGE:PackageCommon_Display_Types});
   
Valid display pages are:

  0..7 for TEXT40_BW (mode 0), TEXT40_CO
        (mode 1) Color/Graphics Adapter
  0..3 for TEXT80_BW (mode 2), TEXT80_CO
        (mode 3) Color/Graphics Adapter
  0..7 for TEXT80_BW (mode 2), TEXT80_CO
        (mode 3) Extended Adapter

Setting an invalid page for the current mode has unpredictable results.

Procedure SET_ACTIVE does not apply to a Monochrome display.

This call corresponds to Interrupt 16#10#, function 16#05#.

An example of using package VIDEO with procedure SET_ACTIVE follows:

   -- set the active display page to page 1.
   --
   VIDEO.SET_ACTIVE(PAGE => 1);
.topic ProcedureScroll_Up
 PROCEDURE SCROLL_UP  (package {VIDEO:PackageVideo}) 
 
Procedure SCROLL_UP scrolls a specified window up and initialize the new
lines with the FILLER_ATTRIBUTE.

   procedure SCROLL_UP(
      NUMBER_OF_LINES : {BYTE:PackageCommon_Display_Types};
      UPPER_ROW       : {ROW_RANGE:PackageCommon_Display_Types};
      LEFT_COLUMN     : {COLUMN_RANGE:PackageCommon_Display_Types};
      LOWER_ROW       : ROW_RANGE;
      RIGHT_COLUMN    : COLUMN_RANGE;
      FILLER_ATTRIBUTE: {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types} := (
         FOREGROUND => WHITE;
         BACKGROUND => BLACK;
         BLINK      => FALSE
      )
   );
      
If the NUMBER_OF_LINES is zero then the entire window is blanked and
initialized with the FILLER_ATTRIBUTE.

Lines scrolled above the top of the window are lost.

Scrolling is only valid for the currently selected display page.

Scrolling invalid windows has unpredictable results.

This call corresponds to Interrupt 16#10#, function 16#06#.

An example of using package VIDEO with procedure SCROLL_UP follows:

   -- define a window with corners 5,10 and 15,30 (row,col)
   -- and scroll it up 4 lines filling in the bottom lines
   -- with a blue background.
   --
   with VIDEO, {COMMON_DISPLAY_TYPES:PackageCommon_Display_Types};
   use  COMMON_DISPLAY_TYPES;
   
   procedure MAKE_WINDOW is
      FILL_ATTR: DISPLAY_ATTRIBUTE;
   begin
      VIDEO.CLEAR_SCREEN;
      FILL_ATTR.BACKGROUND := BLUE;
      VIDEO.SCROLL_UP(
         NUMBER_OF_LINES  => 4,
         UPPER_ROW        => 5,
         LEFT_COLUMN      => 10,
         LOWER_ROW        => 15,
         RIGHT_COLUMN     => 30,
         FILLER_ATTRIBUTE => FILL_ATTR
      );
   end;
.topic ProcedureScroll_Down
 PROCEDURE SCROLL_DOWN  (package {VIDEO:PackageVideo}) 
 
Procedure SCROLL_DOWN scrolls a specified window down and initialize the new
lines with the FILLER_ATTRIBUTE.

   procedure SCROLL_DOWN(
      NUMBER_OF_LINES : {BYTE:PackageCommon_Display_Types};
      UPPER_ROW       : {ROW_RANGE:PackageCommon_Display_Types};
      LEFT_COLUMN     : {COLUMN_RANGE:PackageCommon_Display_Types};
      LOWER_ROW       : ROW_RANGE;
      RIGHT_COLUMN    : COLUMN_RANGE;
      FILLER_ATTRIBUTE: {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types} := (
         FOREGROUND => WHITE;
         BACKGROUND => BLACK;
         BLINK      => FALSE
      )
   );
      
If the NUMBER_OF_LINES is zero then the entire window is blanked and
initialized with the FILLER_ATTRIBUTE.

Scrolling is only valid for the currently selected display page.

Lines scrolled below the bottom of the window are lost.

Scrolling invalid windows has unpredictable results.

This call corresponds to Interrupt 16#10#, function 16#06#.
.topic ProcedureClear_Screen
 PROCEDURE CLEAR_SCREEN  (package {VIDEO:PackageVideo}) 
 
Procedure CLEAR_SCREEN clears the currently selected display page.

   procedure CLEAR_SCREEN;
   
This call corresponds to Interrupt 16#10#, function 16#06#.

An example of using package VIDEO with procedure CLEAR_SCREEN follows:

   -- erase the screen
   --
   VIDEO.CLEAR_SCREEN;
.topic ProcedureRead_Char
 PROCEDURE READ_CHAR  (package {VIDEO:PackageVideo}) 
 
Procedure READ_CHAR allows eight-bit characters (bytes) to be read. Procedure
READ_CHAR obtains the character and its attribute from the current cursor
position in the specified display page.

      procedure READ_CHAR(
         ITEM     : out {EXTENDED_ASCII:PackageCommon_Display_Types};
         ATTRIBUTE: out {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types};
         PAGE     : {DISPLAY_PAGE:PackageCommon_Display_Types} := 0
      );
      
This call corresponds to Interrupt 16#10#, function 16#08#.

An example of using package VIDEO with procedure READ_CHAR follows:

   -- get the character and attribute from display
   -- page zero.
   --
   declare
      CHAR: EXTENDED_ASCII;
      ATTR: DISPLAY_ATTRIBUTE;
   begin
      VIDEO.READ_CHAR(ITEM => CHAR; ATTRIBUTE => ATTR);
   end;
.topic ProcedureWrite_Char
 PROCEDURE WRITE_CHAR  (package {VIDEO:PackageVideo}) 
 
The overloaded WRITE_CHAR procedures are distinguished by the presence of the
ATTRIBUTE parameter and by the type of character written.

See:
   {Write With Attributes:WriteWithAttributes}
   {Write With Previous Attributes:WriteWithPreviousAttributes}
.topic WriteWithAttributes
 PROCEDURE WRITE_CHAR  (package {VIDEO:PackageVideo}) 
 
 Write With Attributes
 
The first and second versions of procedure WRITE_CHAR write a character and
its attribute at the current cursor position in the specified display page.

 Seven-Bit ASCII:
The first version of procedure WRITE_CHAR writes a seven-bit ASCII character.

   procedure WRITE_CHAR(
      ITEM        : CHARACTER;
      REPEAT_COUNT: NATURAL;
      ATTRIBUTE   : {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types} := (
         FOREGROUND => WHITE;
         BACKGROUND => BLACK;
         BLINK      => FALSE
      )
   );
      
The cursor position is not updated.

The results are unpredictable if the REPEAT_COUNT causes characters to be
written past the right side of the screen.

This call corresponds to Interrupt 16#10#, function 16#09#.

An example which uses package VIDEO with procedure WRITE_CHAR follows:

   -- Write a string of 10 happy faces (ASCII ordinal 1) at
   -- the current cursor position.
   --
   with VIDEO;
   
   procedure WRITE_HAPPY is
   begin
      VIDEO.WRITE_CHAR(
         ITEM         => CHARACTER'VAL(1),
         REPEAT_COUNT => 10
      );
   end;

 Eight-Bit Characters
The second version of procedure WRITE_CHAR writes an eight-bit character.

   procedure WRITE_CHAR(
      ITEM        : {EXTENDED_ASCII:PackageCommon_Display_Types};
      REPEAT_COUNT: NATURAL;
      ATTRIBUTE   : {DISPLAY_ATTRIBUTE:PackageCommon_Display_Types} := (
         FOREGROUND => WHITE;
         BACKGROUND => BLACK;
         BLINK      => FALSE
      )
   );
      
The cursor position is not updated.

The results are unpredictable if the REPEAT_COUNT causes characters to be
written past the right side of the screen.

This call corresponds to Interrupt 16#10#, function 16#09#.
.topic WriteWithPreviousAttributes
 PROCEDURE WRITE_CHAR  (package {VIDEO:PackageVideo}) 
 
 Write With Previous Attributes
 
The third and fourth versions of procedure WRITE_CHAR write the character at
the current cursor position in the specified display page with the
already-present attributes.

 Seven-Bit ASCII
The third version of procedure WRITE_CHAR writes a seven-bit ASCII character.

   procedure WRITE_CHAR(
      ITEM        : CHARACTER;
      REPEAT_COUNT: NATURAL;
      PAGE        : {DISPLAY_PAGE:PackageCommon_Display_Types}
   );

The character receives the attribute of the previous character at that
position.

The cursor position is not updated.

The results are unpredictable if the REPEAT_COUNT causes characters to be
written past the right side of the screen.

This call corresponds to Interrupt 16#10#, function 16#0A#.

 Eight-Bit Characters
The fourth version of procedure WRITE_CHAR writes eight-bit characters.

   procedure WRITE_CHAR(
      ITEM        : {EXTENDED_ASCII:PackageCommon_Display_Types};
      REPEAT_COUNT: NATURAL;
      PAGE        : {DISPLAY_PAGE:PackageCommon_Display_Types}
   );

The character receives the attribute of the previous character at that
position.

The cursor position is not updated.

The results are unpredictable if the REPEAT_COUNT causes characters to be
written past the right side of the screen.

This call corresponds to Interrupt 16#10#, function 16#0A#.
.topic ProcedureSet_Color_Palette
 PROCEDURE SET_COLOR_PALETTE  (package {VIDEO:PackageVideo}) 
 
The overloaded SET_COLOR_PALETTE procedures are distinguished by a color
parameter appropriate to the display device.

See:
   {Text or Graphics:TextOrGraphics}
   {CGA:CGA}
.topic TextOrGraphics
 PROCEDURE SET_COLOR_PALETTE  (package {VIDEO:PackageVideo}) 
 
 Text or Graphics
 
The first version of procedure SET_COLOR_PALETTE sets the background and
border color in graphics modes, or sets just the border color in text modes.

   procedure SET_COLOR_PALETTE(TO_COLOR: {COLOR:PackageCommon_Display_Types});

This call corresponds to Interrupt 16#10#, function 16#0B#.

An example which uses package VIDEO with procedure SET_COLOR_PALETTE follows:

   -- set the text modes border color to blue.
   --
   VIDEO.SET_COLOR_PALETTE(TO_COLOR => BLUE);
      -- Note: must already be in a text mode.
.topic CGA
 PROCEDURE SET_COLOR_PALETTE  (package {VIDEO:PackageVideo}) 
 
 CGA
 
The second version of procedure SET_COLOR_PALETTE sets the specified palette
for the Color/Graphics Adapter.

   procedure SET_COLOR_PALETTE(TO_PALETTE: {COLOR_PALETTE:PackageCommon_Display_Types});

This call is valid only in GRAPHIC_4_COLOR mode.

This table indicates what colors are presented:
 Ŀ
  COLOR_PALETTE  GRAPHIC_COLOR                
 Ĵ
        0        BACKGROUND = same as current 
                 COLOR1     = GREEN           
                 COLOR2     = RED             
                 COLOR3     = BROWN           
 Ĵ
        1        BACKGROUND = same as current 
                 COLOR1     = CYAN            
                 COLOR2     = MAGENTA         
                 COLOR3     = WHITE           
 
This call corresponds to Interrupt 16#10#, function 16#0B#.

An example follows:

   -- set the color palette to palette 1.
   --
   VIDEO.SET_COLOR_PALETTE(TO_PALETTE => 1);
.topic ProcedureWrite_Tty
 PROCEDURE WRITE_TTY  (package {VIDEO:PackageVideo}) 
 
The overloaded WRITE_TTY procedures are disambiguated by parameters
appropriate to the output device.

See:
   {Write To Current Display Page:WriteToCurrentDisplayPage}
   {Write Graphic Character:WriteGraphicCharacter}
.topic WriteToCurrentDisplayPage
 PROCEDURE WRITE_TTY  (package {VIDEO:PackageVideo}) 
 
 Write To Current Display Page
 
The first and second versions of procedure WRITE_TTY write a character to the
currently active display page and updates the cursor position.

 Seven-Bit ASCII
The first version of procedure WRITE_TTY writes seven-bit ASCII characters.

   procedure WRITE_TTY(ITEM: CHARACTER);

This call should be made in text modes only.

Appropriate action is taken when these special characters are written:
  bell (ASCII BEL)
  linefeed (ASCII LF)
  carriage return (ASCII CR)
  backspace (ASCII BS)

The display attribute is taken from the previous character at that location.

If the cursor reaches the end of the bottommost screen line, the screen
automatically scrolls up and the cursor is positioned at the "next" line.

This call corresponds to Interrupt 16#10#, function 16#0E#.

An example which uses package VIDEO with procedure WRITE_TTY follows:

   -- write out the string "this is a test"
   --
   with VIDEO;
   
   procedure WRITE_TTY_TEST is
      STR: STRING(1..14) := "this is a test";
   begin
      for I in STR'RANGE loop
         VIDEO.WRITE_TTY(ITEM => STR(I));
      end loop;
   end;

 Eight-Bit Characters
The second version of procedure WRITE_TTY writes eight-bit characters.

   procedure WRITE_TTY(ITEM: {EXTENDED_ASCII:PackageCommon_Display_Types});

Appropriate action is taken when these special characters are written:
  bell (ASCII BEL)
  linefeed (ASCII LF)
  carriage return (ASCII CR)
  backspace (ASCII BS)

The display attribute is taken from the previous character at that location.

If the cursor reaches the end of the bottommost screen line, the screen
automatically scrolls up and the cursor is positioned at the "next" line.

This call corresponds to Interrupt 16#10#, function 16#0E#.

An example follows:

   -- write out the string "this is a test"
   --
   with VIDEO;
   
   procedure WRITE_TTY_TEST2 is
      STR: STRING(1..14) := "this is a test";
   begin
      for I in STR'RANGE loop
         VIDEO.WRITE_TTY(ITEM => CHARACTER'POS(STR(I)));
      end loop;
   end;
.topic WriteGraphicCharacter
 PROCEDURE WRITE_TTY  (package {VIDEO:PackageVideo}) 
 
 Write Graphic Character
 
The third version of procedure WRITE_TTY writes a graphic character with the
specified attribute.

   procedure WRITE_TTY(
      ITEM       : CHARACTER;
      WHICH_COLOR: {PIXEL_VALUE:PackageVideo}
   );

The results are unpredictable if the current display mode is not a graphic
mode.

If the cursor reaches the end of the bottommost screen line, the screen
automatically scrolls up and the cursor is positioned at the "next" line.

This call corresponds to Interrupt 16#10#, function 16#0E#.
.topic ProcedureWrite_Pixel
 PROCEDURE WRITE_PIXEL  (package {VIDEO:PackageVideo}) 
 
Procedure WRITE_PIXEL turns on a pixel at the specified location.

   procedure WRITE_PIXEL(
      PIXEL_COLOR : {PIXEL_VALUE:PackageVideo};
      PIXEL_ROW   : NATURAL;
      PIXEL_COLUMN: NATURAL
   );

Valid display locations depend on the current graphic mode. The results are
unpredictable for invalid coordinates.

This call corresponds to Interrupt 16#10#, function 16#0C#.
.topic FunctionRead_Pixel
 FUNCTION READ_PIXEL  (package {VIDEO:PackageVideo}) 
 
Function READ_PIXEL obtains the {PIXEL_VALUE:PackageVideo} for the specified
position.

   function READ_PIXEL(
      PIXEL_ROW   : NATURAL;
      PIXEL_COLUMN: NATURAL
   )  return PIXEL_VALUE;

Valid display locations depend on the current graphic mode.

This call corresponds to Interrupt 16#10#, function 16#0C#.
.topic ProcedureWrite_Graphic_Char
 PROCEDURE WRITE_GRAPHIC_CHAR  (package {VIDEO:PackageVideo}) 
 
Procedure WRITE_GRAPHIC_CHAR writes a graphic character at the current cursor
location.

   procedure WRITE_GRAPHIC_CHAR(
      ITEM        : CHARACTER;
      ATTRIBUTE   : {PIXEL_VALUE:PackageVideo};
      REPEAT_COUNT: NATURAL
   );

The cursor position is not updated.

This call is valid only in graphics mode.

The results are unpredictable if the REPEAT_COUNT causes characters to be
written past the right side of the screen.

This call corresponds to Interrupt 16#10#, function 16#0A#.

An example which uses package VIDEO with procedure WRITE_GRAPHIC_CHAR
follows:

   -- write the 10 graphic '?' characters,
   -- wait 2 seconds then erase it.
   -- (graphics mode is assumed)
   --
   with VIDEO, {COMMON_DISPLAY_TYPES:PackageCommon_Display_Types};
   use  VIDEO, COMMON_DISPLAY_TYPES;
   
   procedure GRAPHIC_TEST is
      ATTR: PIXEL_VALUE;
   begin
      ATTR.PIXEL_COLOR := COLOR1;
      WRITE_GRAPHIC_CHAR(
         ITEM         => '?',
         ATTRIBUTE    => ATTR,
         REPEAT_COUNT => 10
      );
      DELAY 2.0;
      ATTR.XOR_BIT := TRUE;
      WRITE_GRAPHIC_CHAR(
         ITEM         => '?',
         ATTRIBUTE    => ATTR,
         REPEAT_COUNT => 10
      );
   end;
.topic Attributes
 PREDEFINED LANGUAGE ATTRIBUTES 
 
See:
  {ADDRESS}
  {AFT}
  {BASE}
  {CALLABLE}
  {CONSTRAINED}
  {COUNT}
  {DELTA}
  {DIGITS}
  {EMAX}
  {EPSILON}
  {FIRST}
  {FIRST_BIT}
  {FORE}
  {IMAGE}
  {LARGE}
  {LAST}
  {LAST_BIT}
  {LENGTH}
  {MACHINE_EMAX}
  {MACHINE_EMIN}
  {MACHINE_MANTISSA}
  {MACHINE_OVERFLOWS}
  {MACHINE_RADIX}
  {MACHINE_ROUNDS}
  {MANTISSA}
  {POS}
  {POSITION}
  {PRED}
  {RANGE}
  {SAFE_EMAX}
  {SAFE_LARGE}
  {SAFE_SMALL}
  {SIZE}
  {SMALL}
  {STORAGE_SIZE}
  {SUCC}
  {TERMINATED}
  {VAL}
  {VALUE}
  {WIDTH}
.topic ADDRESS
 P'ADDRESS

For a prefix P that denotes an object, a program unit, a label, or an entry:

Yields the address of the first of the storage units allocated to P. For a
subprogram, package, task unit, or label, this value refers to the machine
code associated with the corresponding body or statement. For an entry for
which an address clause has been given, the value refers to the corresponding
hardware interrupt. The value of this attribute is of the type ADDRESS
defined in the package SYSTEM. (See 13.7.2.)
.topic AFT
 P'AFT

For a prefix P that denotes a fixed point subtype:

Yields the number of decimal digits needed after the point to accommodate
the precision of the subtype P, unless the delta of the subtype P is
greater than 0.1, in which case the attribute yields the value one. (P'AFT
is the smallest positive integer N for which (10**N)*P'DELTA is greater than
or equal to one.) The value of this attribute is of the type
universal_integer. (See 3.5.10.)
.topic BASE
 P'BASE

For a prefix P that denotes a type or subtype:

This attribute denotes the base type of P. It is only allowed as the prefix
of the name of another attribute: for example, P'BASE'FIRST. (See 3.3.3.)
.topic CALLABLE
 P'CALLABLE

For a prefix P that is appropriate for a task type:

Yields the value FALSE when the execution of the task P is either completed
or terminated, or when the task is abnormal; yields the value TRUE otherwise.
The value of this attribute is of the predefined type BOOLEAN. (See 9.9.)
.topic CONSTRAINED
 P'CONSTRAINED

For a prefix P that denotes an object of a type with discriminants:

Yields the value TRUE if a discriminant constraint applies to the object P,
or if the object is a constant (including a formal parameter or generic
formal parameter of mode in); yields the value FALSE otherwise. If P is a
generic formal parameter of mode in out, or if P is a formal parameter of
mode in out or out and the type mark given in the corresponding parameter
specification denotes an unconstrained type with discriminants, then the
value of this attribute is obtained from that of the corresponding actual
parameter. The value of this attribute is of the predefined type BOOLEAN.
(See 3.7.4.)

 P'CONSTRAINED

For a prefix P that denotes a private type or subtype:

Yields the value FALSE if P denotes an unconstrained nonformal private type
with discriminants; also yields the value FALSE if P denotes a generic formal
private type and the associated actual subtype is either an unconstrained
type with discriminants or an unconstrained array type; yields the value TRUE
otherwise. The value of this attribute is of the predefined type BOOLEAN.
(See 7.4.2.)
.topic COUNT
 P'COUNT

For a prefix P that denotes an entry of a task unit:

Yields the number of entry calls presently queued on the entry (if the
attribute is evaluated within an accept statement for the entry P, the count
does not include the calling task). The value of this attribute is of the
type universal_integer. (See 9.9.)
.topic DELTA
 P'DELTA

For a prefix P that denotes a fixed point  subtype:

Yields the value of the delta specified in the fixed accuracy definition for
the subtype P. The value of this attribute is of the type universal_real.
(See 3.5.10.)
.topic DIGITS
 P'DIGITS

For a prefix P that denotes a floating point subtype:

Yields the number of decimal digits in the decimal mantissa of model numbers
of the subtype P. (This attribute yields the number D of section 3.5.7.) The
value of this attribute is of the type universal_integer. (See 3.5.8.)
.topic EMAX
 P'EMAX

For a prefix P that denotes a floating point  subtype:

Yields the largest exponent value in the binary canonical form of model
numbers of the subtype P. (This attribute yields the product 4*B of section
3.5.7.) The value of this attribute is of the type universal_integer.
(See 3.5.8.)
.topic EPSILON
 P'EPSILON

For a prefix P that denotes a floating point subtype:

Yields the absolute value of the difference between the model number 1.0 and
the next model number above, for the subtype P. The value of this attribute
is of the type universal_real. (See 3.5.8.)
.topic FIRST
 P'FIRST

For a prefix P that denotes a scalar type, or a subtype of a scalar type:

Yields the lower bound of P. The value of this attribute has the same type
as P. (See 3.5.)

 P'FIRST

For a prefix P that is appropriate for an array type, or that denotes a
constrained array subtype:

Yields the lower bound of the first index range. The value of this attribute
has the same type as this lower bound. (See 3.6.2 and 3.8.2.)

 P'FIRST(N)

For a prefix P that is appropriate for an array type, or that denotes a
constrained array subtype:

Yields the lower bound of the N-th index range. The value of this attribute
has the same type as this lower bound. The argument N must be a static
expression of type universal_integer. The value of N must be positive
(nonzero) and no greater than the dimensionality of the array. (See 3.6.2
and 3.8.2.)
.topic FIRST_BIT
 P'FIRST_BIT

For a prefix P that denotes a component of a record object:

Yields the offset, from the start of the first of the storage units occupied
by the component, of the first bit occupied by the component. This offset is
measured in bits. The value of this attribute is of the type
universal_integer. (See 13.7.2.)
.topic FORE
 P'FORE

For a prefix P that denotes a fixed point subtype:

Yields the minimum number of characters needed for the integer part of the
decimal representation of any value of the subtype P, assuming that the
representation does not include an exponent, but includes a one-character
prefix that is either a minus sign or a space. (This minimum number does not
include superfluous zeros or underlines, and is at least two.) The value of
this attribute is of the type universal_integer. (See 3.5.10.)
.topic IMAGE
 P'IMAGE

For a prefix P that denotes a discrete type or subtype:

This attribute is a function with a single parameter. The actual parameter
X must be a value of the base type of P. The result type is the predefined
type STRING. The result is the image of the value of X, that is, a sequence
of characters representing the value in display form. The image of an integer
value is the corresponding decimal literal; without underlines, leading
zeros, exponent, or trailing spaces; but with a one character prefix that is
either a minus sign or a space.

The image of an enumeration value is either the corresponding identifier in
upper case or the corresponding character literal (including the two
apostrophes); neither leading nor trailing spaces are included. The image of
a character other than a graphic character is implementation-defined.
(See 3.5.5.)
.topic LARGE
 P'LARGE

For a prefix P that denotes a real subtype:

The attribute yields the largest positive model number of the subtype P. The
value of this attribute is of the type universal_real. (See 3.5.8 and 3.5.10.)
.topic LAST
 P'LAST

For a prefix P that denotes a scalar type, or a subtype of a scalar type:

Yields the upper bound of P. The value of this attribute has the same type
as P. (See 3.5.)

 P'LAST

For a prefix P that is appropriate for an array type, or that denotes a
constrained array subtype:

Yields the upper bound of the first index range. The value of this attribute
has the same type as this upper bound. (See 3.6.2 and 3.8.2.)

 P'LAST(N)

For a prefix P that is appropriate for an array type, or that denotes a
constrained array subtype:

Yields the upper bound of the N-th index range. The value of this attribute
has the same type as this upper bound. The argument N must be a static
expression of type universal_integer. The value of N must be positive
(nonzero) and no greater than the dimensionality of the array. (See 3.6.2
and 3.8.2.)
.topic LAST_BIT
 P'LAST_BIT

For a prefix P that denotes a component of a record object:

Yields the offset, from the start of the first of the storage units occupied
by the component, of the last bit occupied by the component. This offset is
measured in bits. The value of this attribute is of the type
universal_integer. (See 13.7.2.)
.topic LENGTH
 P'LENGTH

For a prefix P that is appropriate for an array type, or that denotes a
constrained array subtype:

Yields the number of values of the first index range (zero for a null range).
The value of this attribute is of the type universal_integer. (See 3.6.2.)

 P'LENGTH(N)

For a prefix P that is appropriate for an array type, or that denotes a
constrained array subtype:

Yields the number of values of the N-th index range (zero for a null range).
The value of this attribute is of the type universal_integer. The argument N
must be a static expression of type universal_integer. The value of N must be
positive (nonzero) and no greater than the dimensionality of the array.
(See 3.6.2 and 3.8.2.)
.topic MACHINE_EMAX
 P'MACHINE_EMAX

For a prefix P that denotes a floating point type or subtype:

Yields the largest value of exponent for the machine representation of the
base type of P. The value of this attribute is of the type universal_integer.
(See 13.7.3.)
.topic MACHINE_EMIN
 P'MACHINE_EMIN

For a prefix P that denotes a floating point type or subtype:

Yields the smallest (most negative) value of exponent for the machine
representation of the base type of P. The value of this attribute is of the
type universal_integer. (See 13.7.3.)
.topic MACHINE_MANTISSA
 P'MACHINE_MANTISSA

For a prefix P that denotes a floating point type or subtype:

Yields the number of digits in the mantissa for the machine representation
of the base type of P (the digits are extended digits in the range 0 to
P'MACHINE_RADIX - 1). The value of this attribute is of the type
universal_integer. (See 13.7.3.)
.topic MACHINE_OVERFLOWS
 P'MACHINE_OVERFLOWS

For a prefix P that denotes a real type or subtype:

Yields the value TRUE if every predefined operation on values of the base
type of P either provides a correct result, or raises the exception
NUMERIC_ERROR in overflow situations; yields the value FALSE otherwise. The
value of this attribute is of the predefined type BOOLEAN. (See 13.7.3.)
.topic MACHINE_RADIX
 P'MACHINE_RADIX

For a prefix P that denotes a floating point type or subtype:

Yields the value of the radix used by the machine representation of the
base type of P. The value of this attribute is of the type universal_integer.
(See 13.7.3.)
.topic MACHINE_ROUNDS
 P'MACHINE_ROUNDS

For a prefix P that denotes a real type or subtype:

Yields the value TRUE if every predefined arithmetic operation on values of
the base type of P either returns an exact result or performs rounding;
yields the value FALSE otherwise. The value of this attribute is of the
predefined type BOOLEAN. (See 13.7.3.)
.topic MANTISSA
 P'MANTISSA

For a prefix P that denotes a real subtype:

Yields the number of binary digits in the binary mantissa of model numbers
of the subtype P. (This attribute yields the number B of section 3.5.7 for
a floating point type, or of section 3.5.9 for a fixed point type.) The value
of this attribute is of the type universal_integer. (See 3.5.8 and 3.5.10.)
.topic POS
 P'POS

For a prefix P that denotes a discrete type or subtype:

This attribute is a function with a single parameter. The actual parameter
X must be a value of the base type of P. The result type is the type
universal_integer. The result is the position number of the value of the
actual parameter. (See 3.5.5.)
.topic POSITION
 P'POSITION

For a prefix P that denotes a component of a record object:

Yields the offset, from the start of the first storage unit occupied by the
record, of the first of the storage units occupied by the component. This
offset is measured in storage units. The value of this attribute is of the
type universal_integer. (See 13.7.2.)
.topic PRED
 P'PRED

For a prefix P that denotes a discrete type or subtype:

This attribute is a function with a single parameter. The actual parameter
X must be a value of the base type of P. The result type is the base type of
P. The result is the value whose position number is one less than that of X.
The exception CONSTRAINT_ERROR is raised if X equals P'BASE'FIRST.
(See 3.5.5.)
.topic RANGE
 P'RANGE

For a prefix P that is appropriate for an array type, or that denotes a
constrained array subtype:

Yields the first index range of P, that is, the range P'FIRST .. P'LAST.
(See 3.6.2.)

 P'RANGE(N)

For a prefix P that is appropriate for an array type, or that denotes a
constrained array subtype:

Yields the N-th index range of P, that is, the range P'FIRST(N) .. P'LAST(N).
(See 3.6.2.)
.topic SAFE_EMAX
 P'SAFE_EMAX

For a prefix P that denotes a floating point type or subtype:

Yields the largest exponent value in the binary canonical form of safe
numbers of the base type of P. (This attribute yields the number E of section
3.5.7.) The value of this attribute is of the type universal_integer.
(See 3.5.8.)
.topic SAFE_LARGE
 P'SAFE_LARGE

For a prefix P that denotes a real type or subtype:

Yields the largest positive safe number of the base type of P. The value of
this attribute is of the type universal_real. (See 3.5.8 and 3.5.10.)
.topic SAFE_SMALL
 P'SAFE_SMALL

For a prefix P that denotes a real type or subtype:

Yields the smallest positive (nonzero) safe number of the base type of P. The
value of this attribute is of the type universal_real. (See 3.5.8 and 3.5.10.)
.topic SIZE
 P'SIZE

For a prefix P that denotes an object:

Yields the number of bits allocated to hold the object. The value of this
attribute is of the type universal_integer. (See 13.7.2.)

 P'SIZE

For a prefix P that denotes any type or subtype:

Yields the minimum number of bits that is needed by the implementation to
hold any possible object of the type or subtype P. The value of this
attribute is of the type universal_integer. (See 13.7.2.)
.topic SMALL
 P'SMALL

For a prefix P that denotes a real subtype:

Yields the smallest positive (nonzero) model number of the subtype P. The
value of this attribute is of the type universal_real. (See 3.5.8 and 3.5.10.)
.topic STORAGE_SIZE
 P'STORAGE_SIZE

For a prefix P that denotes an access type or subtype:

Yields the total number of storage units reserved for the collection
associated with the base type of P. The value of this attribute is of the
type universal_integer. (See 13.7.2.)

 P'STORAGE_SIZE

For a prefix P that denotes a task type or a task object:

Yields the number of storage units reserved for each activation of a task
of the type P or for the activation of the task object P. The value of this
attribute is of the type universal_integer. (See 13.7.2.)
.topic SUCC
 P'SUCC

For a prefix P that denotes a discrete type or subtype:

This attribute is a function with a single parameter. The actual parameter
X must be a value of the base type of P. The result type is the base type of
P. The result is the value whose position number is one greater than that of
X. The exception CONSTRAINT_ERROR is raised if X equals P'BASE'LAST.
(See 3.5.5.)
.topic TERMINATED
 P'TERMINATED

For a prefix P that is appropriate for a task type:

Yields the value TRUE if the task P is terminated; yields the value FALSE
otherwise. The value of this attribute is of the predefined type BOOLEAN.
(See 9.9.)
.topic VAL
 P'VAL

For a prefix P that denotes a discrete type or subtype:

This attribute is a special function with a single parameter X which can be
of any integer type. The result type is the base type of P. The result is the
value whose position number is the universal_integer value corresponding to
X. The exception CONSTRAINT_ERROR is raised if the universal_integer valu
corresponding to X is not in the range P'POS(P'BASE'FIRST) ..
P'POS(P'BASE'LAST). (See 3.5.5.)
.topic VALUE
 P'VALUE

For a prefix P that denotes a discrete type or subtype:

This attribute is a function with a single parameter. The actual parameter
X must be a value of the predefined type STRING. The result type is the base
type of P. Any leading and any trailing spaces of the sequence of characters
that corresponds to X are ignored.

For an enumeration type, if the sequence of characters has the syntax of
an enumeration literal and if this literal exists for the base type of P, the
result is the corresponding enumeration value. For an integer type, if the
sequence of characters has the syntax of an integer literal, with an optional
single leading character that is a plus or minus sign, and if there is a
corresponding value in the base type of P, the result is this value. In any
other case, the exception CONSTRAINT_ERROR is raised. (See 3.5.5.)
.topic WIDTH
 P'WIDTH

For a prefix P that denotes a discrete subtype:

Yields the maximum image length over all values of the subtype P (the image
is the sequence of characters returned by the attribute IMAGE). The value of
this attribute is of the type universal_integer. (See 3.5.5.)
