Prev | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help


A.10.7 Input-Output of Characters and Strings

Static Semantics
(1)
For an item of type Character the following procedures are provided:
(2)
       procedure Get(File : in File_Type; Item : out Character);
       procedure Get(Item : out Character);
(3)
(4)
(5)
       procedure Put(File : in File_Type; Item : in Character);
       procedure Put(Item : in Character);
(6)
(7)
       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);
(8)
(9)
       procedure Get_Immediate(File : in  File_Type;
                               Item : out Character);
       procedure Get_Immediate(Item : out Character);
(10)
(11)
       procedure Get_Immediate(File      : in  File_Type;
                               Item      : out Character;
                               Available : out Boolean);
       procedure Get_Immediate(Item      : out Character;
                               Available : out Boolean);
(12)
(13)
(14)
       procedure Get(File : in File_Type; Item : out String);
       procedure Get(Item : out String);
(15)
(16)
       procedure Put(File : in File_Type; Item : in String);
       procedure Put(Item : in String);
(17)
(18)
       procedure Get_Line(File : in File_Type; Item : out String; Last : out Natural);
       procedure Get_Line(Item : out String;   Last : out Natural);
(19)
(20)
(21)
       procedure Put_Line(File : in File_Type; Item : in String);
       procedure Put_Line(Item : in String);
(22)
Implementation Advice
(23)
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.

(24)
(25)
(26)

Prev | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help

Ada WWW Home -- Email comments, additions, corrections, gripes, kudos, etc. to:

Magnus Kempe -- Magnus.Kempe@di.epfl.ch
Copyright statement
Page last generated: 95-03-12