Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I know that now, even though some of the details remain fuzzy (Get_Line reads 100 characters?), but it's just that the documentation is a big pile of facts with very little to guide you towards the right function/type. And then to get it to use in the rest of the code. And of course, many 'modern' helpers are simply not available, so that too takes a bit of time to find out. But that's learning.


It stops at 100 or the length of the supplied string or the end of the line, whichever is shorter. You can also use unbounded strings which allows you to skip specifying the size for the output.

  with Ada.Strings.Unbounded.Text_IO;
  use Ada.Strings.Unbounded.Text_IO;

  with Ada.Strings.Unbounded;
  use Ada.Strings.Unbounded;

  procedure main is
    Line: Unbounded_String;
  begin
    Line := Get_Line;
    Put_Line(Line);
  end main;
https://learn.adacore.com - good source of tutorials, unfortunately a lot of the better learning materials beyond this are books, not online tutorials.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: