DocAda(tm) is a productivity tool of KSCE

Prev | Up | Next | Back | Forward
About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News

A.10.7 Input-Output of Characters and Strings

Static Semantics

For an item of type Character the following procedures are provided:

   
       procedure Get(File : in File_Type; Item : out Character);
       procedure Get(Item : out Character);
   
       procedure Put(File : in File_Type; Item : in Character);
       procedure Put(Item : in Character);
   
       procedure Look_Ahead (File        : in  File_Type;
                             Item        : out Character;
                             End_Of_Line : out Boolean);
       procedure Look_Ahead (Item        : out Character;
                             End_Of_Line : out Boolean);
   
       procedure Get_Immediate(File : in  File_Type;
                               Item : out Character);
       procedure Get_Immediate(Item : out Character);
    
       procedure Get_Immediate(File      : in  File_Type;
                               Item      : out Character;
                               Available : out Boolean);
       procedure Get_Immediate(Item      : out Character;
                               Available : out Boolean);
    
       procedure Get(File : in File_Type; Item : out String);
       procedure Get(Item : out String);
    
       procedure Put(File : in File_Type; Item : in String);
       procedure Put(Item : in String);
    
       procedure Get_Line(File : in File_Type; Item : out String; Last : out Natural);
       procedure Get_Line(Item : out String;   Last : out Natural);
    
       procedure Put_Line(File : in File_Type; Item : in String);
       procedure Put_Line(Item : in String);

Implementation Advice

The Get_Immediate procedures should be implemented with unbuffered input. For a device such as a keyboard, input should be ``available'' if a key has already been typed, whereas for a disk file, input should always be available except at end of file. For a file associated with a keyboard-like device, any line-editing features of the underlying operating system should be disabled during the execution of Get_Immediate.

About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News
Prev | Up | Next | Back | Forward


Copyright © 1994-1997 by Kempe Software Capital Enterprises. All Rights Reserved. For comments on this DocAda(tm) hypertext document, please write to KSCE, at docada@ksce.com