Z's space

2012-05-10

Get_Line problem

Filed under: Ada programming,Programming — by zhuqy @ 15:39
Tags: ,

This is old story, but I am still referring to it sometimes as I am still new to Ada programming.

Links at: comp.lang.ada

So the best pratice to read a line is like the code from wikibook Ada Programming:

 declare
     The_Line: String(1..100);
     Last: Natural;
  begin
     loop
        Text_IO.Get_Line(The_Line, Last);
        --  do something with The_Line ...
     end loop;
  exception
     when Text_IO.End_Error =>
        null;
  end;

Blog at WordPress.com.