AdaPower Logged in as Guest
Ada Tools and Resources

Ada 95 Reference Manual
Ada Source Code Treasury
Bindings and Packages
Ada FAQ


Join >
Articles >
Ada FAQ >
Getting Started >
Home >
Books & Tutorials >
Source Treasury >
Packages for Reuse >
Latest Additions >
Ada Projects >
Press Releases >
Ada Audio / Video >
Home Pages >
Links >
Contact >
About >
Login >
Back
GNAT.IO Example (David Botton)

-- GNAT.IO Example
--
-- GNAT.IO offers:
--    A simple preelaborable subset of Text_IO capabilities

with Gnat.IO; use Gnat.IO;

procedure Gio is
   Test_Integer       : Integer;
   Test_String        : String (1 .. 255);
   Test_String_Length : Natural;
   Test_Character     : Character;
begin

   Put_Line("Type an Integer");
   Get(Test_Integer);

   -- Used to clean off the new line from the buffer
   -- after pushing enter on the last get since
   -- a get only removes the what it is looking for and
   -- leaves everything else in the input buffer.
   Get(Test_Character);

   Put("You typed : ");
   Put(Test_Integer);
   New_Line;

   Put_Line("What is your name?");
   Get_Line(Test_String,
            Test_String_Length);

   Put_Line("Hello, " & Test_String(1 .. Test_String_Length)& "!");
   Put_Line("Press <ENTER> when done.");
   Get(Test_Character);
   Put(Test_Character);

end Gio;


(c) 1998-2004 All Rights Reserved David Botton