comp.lang.ada
 help / color / mirror / Atom feed
* Re : Simple call of Procedure with Ada.float_text_IO.Get
@ 2015-11-02 12:33 comicfanzine
  2015-11-02 13:03 ` Jacob Sparre Andersen
  0 siblings, 1 reply; 18+ messages in thread
From: comicfanzine @ 2015-11-02 12:33 UTC (permalink / raw)


Hi , i have a code with a procedure call and i got the following errors , i understand them but i don't know how to fixe them :

log_in.adb:28:17: no candidate interpretations match the actuals:
log_in.adb:28:17: missing argument for parameter "From" in call to "get" declared at identification.ads:8
log_in.adb:28:17: missing argument for parameter "Password" in call to "get" declared at identification.ads:7

I have 3 files (packagefile.adb , packagefile.ads and the mainprogram(log_in) :

=================
with Ada.Text_IO;
with Identification;
with Ada.float_text_IO;

Procedure log_in is

   Procedure check_password is 

   Password : Identification.Password_Value;
   
   begin

   Identification.Get (Password => Password);
   
if Password = "admin" then
      Ada.Text_IO.Put_Line (Item => "Welcome, Administrator.");
   end if;
   
end check_password;

   virgules :  Identification.virgules_Value ;
   
begin

   check_password;
   -- Here i want the procedure check_password be executed before log_in , for the arguments given to  Ada.float_text_IO.Get 
   
  Identification.Get (virgules => virgules);
    if virgules'Valid then 
        Ada.Text_IO.Put_Line("A float number was not asked") ;
end if;			end log_in;

=================
with Ada.Text_IO;
with Ada.Float_Text_IO;  

package body identification is

procedure Get (Password : out Password_Value ) is

procedure Get 
     (From : in Password_Value;
      Item : out virgules_Value;
      Last : out Positive_package_declaration_need);  is

begin
      Ada.float_text_IO.get(Item => virgules); Skip_line  ; 
end Get;
begin
Ada.Text_IO.Put (Item => "Hello, User. What's your name? ");

      Get_Name : declare
         Name : constant String := Ada.Text_IO.Get_Line;
      begin 
         if Name /= "fanzine" then
            Ada.Text_IO.Put_Line (Item => "You're not Administrator.");
	    procedure Get 
     (From : in Password_Value;
      Item : out virgules_Value;
      Last : out Positive_package_declaration_need);
         else 
            Ada.Text_IO.Get (Item => Password); 
            Ada.Text_IO.Skip_Line;
            Ada.Text_IO.New_Line;
         end if;
      end Get_Name;
   end Get;
end identification;
=====================
package identification is

   subtype Password_Value is String (1..5);
   subtype virgules_Value is Float ; 
   subtype Positive_package_declaration_need is Positive ;
   
   procedure Get (Password : out Password_Value);
    procedure Get 
     (From : in Password_Value;
      Item : out virgules_Value;
      Last : out Positive_package_declaration_need);
-- "Last" is in the declaration in Ada.float_text_IO.Get , i don't know if i can , not use it and if it silll going to work after that .
end identification;


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-11-04 16:06 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02 12:33 Re : Simple call of Procedure with Ada.float_text_IO.Get comicfanzine
2015-11-02 13:03 ` Jacob Sparre Andersen
2015-11-02 14:46   ` comicfanzine
2015-11-02 17:23     ` Jacob Sparre Andersen
2015-11-02 21:51       ` comicfanzine
2015-11-02 23:02         ` AdaMagica
2015-11-03 11:42           ` comicfanzine
2015-11-03 11:52           ` comicfanzine
2015-11-03 18:40           ` comicfanzine
2015-11-03 19:02             ` Jeffrey R. Carter
2015-11-03 20:27             ` Simon Wright
2015-11-03 23:14               ` comicfanzine
2015-11-03 23:36               ` comicfanzine
2015-11-04 10:30                 ` Simon Wright
2015-11-04 12:39                   ` comicfanzine
2015-11-04 14:37                   ` comicfanzine
2015-11-04 16:06                     ` Simon Wright
2015-11-03  6:44         ` Randy Brukardt

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