File: test_get.adb

package info (click to toggle)
adacgi 1.6-9
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 280 kB
  • ctags: 21
  • sloc: ada: 1,068; makefile: 86
file content (23 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

-- Test_Get is a short program that tests package Ustrings.

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

procedure Test_Get is

   The_Line : Unbounded_String;

begin
   Put_Line("Type in test text and press return.");
   Put_Line("Enter a blank line when finished.");
   loop
      Get_Line (The_Line);
      exit when Length(The_Line) = 0;
      Put (Integer'Image(Length(The_Line)) & ": ");
      Put_Line (The_Line);
   end loop;
end Test_Get;