comp.lang.ada
 help / color / mirror / Atom feed
* need a little string hint...
@ 2005-02-28 16:08 mferracini
  2005-02-28 16:26 ` Adrien Plisson
  2005-03-01  3:07 ` Steve
  0 siblings, 2 replies; 12+ messages in thread
From: mferracini @ 2005-02-28 16:08 UTC (permalink / raw)


i need to read from a file "config.sys" host&port number.
but i have a problem with host...

if i call: Get_Host_By_Name ("localhost") it work fine,
i i use the string read from the file don't work.

an hint?

grazie.

-------------------------------------------------------------

procedure Client is
   Server     : Sock_Addr_Type;
   Config     : Ada.Text_Io.File_Type;
   Host       : String (1 .. 20)      := (others => ' ');
   Port_Value : String (1 .. 20)      := (others => ' ');
   Last       : Natural               := 0;
   Port       : Port_type             := 0;

begin
   --Inizializza
    --leggi da config
   Ada.Text_Io.Open(
      File => Config,
      Mode => Ada.Text_Io.In_File,
      Name => "config.ini"); --case sensitive?

   Ada.Text_Io.Get_Line(
      File => Config,
      Item => Host,
      Last => Last);

   Ada.Text_Io.Get_Line(
      File => Config,
      Item => Port_Value,
      Last => Last);
   Ada.Integer_Text_Io.Get(Port_Value,natural(Port),Last);

    --open socket
   Initialize(False); --true??
   Server.Addr := Addresses (Get_Host_By_Name (host), 1);
   Server.Port := Port;
   Ada.Text_Io.Put_Line("OK");




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

end of thread, other threads:[~2005-03-03  6:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-28 16:08 need a little string hint mferracini
2005-02-28 16:26 ` Adrien Plisson
2005-02-28 16:49   ` mferracini
2005-02-28 16:53     ` Andre
2005-02-28 17:29       ` Adrien Plisson
2005-03-01 21:25         ` Simon Wright
2005-03-01 22:29           ` Adrien Plisson
2005-03-03  6:19             ` Simon Wright
2005-02-28 17:49     ` Jeffrey Carter
2005-02-28 16:51   ` mferracini
2005-02-28 16:59     ` Adrien Plisson
2005-03-01  3:07 ` Steve

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