home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-os2-bin-20010916.zip / emx / gnat / examples / hello.adb < prev    next >
Text File  |  2000-07-19  |  899b  |  35 lines

  1. With Gnat.IO; use Gnat.IO;
  2. procedure Hello is
  3.    C : Character;
  4.    I : Integer;
  5.    S : String (1 .. 100);
  6. begin
  7.    Put_Line ("Hello. Welcome to the GNAT IO example" & "!");
  8.    New_Line;
  9.    Put ("Note: This example uses GNAT.IO which does not raise Data_Error");
  10.    Put_Line (" for bad data.");
  11.    Put ("      ");
  12.    Put_Line ("For that you need to use the standard package Ada.Text_IO.");
  13.    New_line;
  14.    Put ("Please enter a single character now followed by <CR> ");
  15.    Get (C);
  16.    Put ("Your character is: ");
  17.    Put (C);
  18.    Get (C);  --  read the <CR>
  19.    New_Line (2);
  20.  
  21.    Put ("Please enter a String now followed by <CR> :");
  22.    Get_Line (S, I);
  23.    Put ("Your String is : ");
  24.    Put_Line (S (1 .. I));
  25.    Put ("Its length is : ");
  26.    Put (I);
  27.    New_Line (2);
  28.  
  29.    Put ("Please enter an integer now followed by <CR> ");
  30.    Get (I);
  31.    Put ("Your number is: ");
  32.    Put (I);
  33.    New_Line (2);
  34. end; 
  35.