comp.lang.ada
 help / color / mirror / Atom feed
From: John Smith <yoursurrogategod@gmail.com>
Subject: Why am I getting "missing operand" from get_line()?
Date: Mon, 30 May 2016 13:31:22 -0700 (PDT)
Date: 2016-05-30T13:31:22-07:00	[thread overview]
Message-ID: <98217530-0216-4bc1-9d3c-167c5cb38b7f@googlegroups.com> (raw)

This is my code:

-- run_time_entry.adb:

with Ada.Text_IO.Unbounded_IO;
with Ada.Text_IO;

procedure Run_Time_Entry is
  First_Name : Ada.Strings.Unbounded.Unbounded_String;
  Last_Name  : Ada.Strings.Unbounded.Unbounded_String;
begin
  Ada.Text_IO.Put("Hello.  What is your first name => ");
  First_Name := Ada.Text_IO.Unbounded_IO.Get_Line();
  Ada.Text_IO.Put("What is your last name => ");
  Last_Name  := Ada.Text_IO.Unbounded_IO.Get_Line();

  Ada.Text_IO.Put("Nice to meet you ");
  Ada.Text_IO.Unbounded_IO.Put(First_Name);
  Ada.Text_IO.Put("  ");
  Ada.Text_IO.Unbounded_IO.Put_Line(Last_Name);
end Run_Time_Entry;




This is what happens when I compile it:

> gnatmake -g .\run_time_entry.adb
gcc -c -I.\ -g -I- .\run_time_entry.adb
run_time_entry.adb:11:51: missing operand
run_time_entry.adb:13:51: missing operand
gnatmake: ".\run_time_entry.adb" compilation error

Lines 11 and 13 is where I call Get_Line.  I don't understand, the reference manual (for 2012) says that this function ought to exist and it returns a string.

What am I missing?


             reply	other threads:[~2016-05-30 20:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30 20:31 John Smith [this message]
2016-05-30 20:36 ` Why am I getting "missing operand" from get_line()? Egil H H
2016-05-30 23:09   ` John Smith
2016-05-30 23:59     ` Jeffrey R. Carter
2016-05-31  0:12       ` John Smith
2016-05-31  5:40     ` Egil H H
2016-05-31  5:51       ` Niklas Holsti
2016-06-01 22:21   ` daserlang
2016-06-02 12:57   ` mockturtle
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox