From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,341ea6d4f1d28719,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!l41g2000cwc.googlegroups.com!not-for-mail From: "mferracini" Newsgroups: comp.lang.ada Subject: need a little string hint... Date: 28 Feb 2005 08:08:35 -0800 Organization: http://groups.google.com Message-ID: <1109606915.447479.184780@l41g2000cwc.googlegroups.com> NNTP-Posting-Host: 213.215.153.30 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1109606920 22912 127.0.0.1 (28 Feb 2005 16:08:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 28 Feb 2005 16:08:40 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: l41g2000cwc.googlegroups.com; posting-host=213.215.153.30; posting-account=OjhBzA0AAAC7IWpsLrvIpzjmXdzmh93y Xref: g2news1.google.com comp.lang.ada:8531 Date: 2005-02-28T08:08:35-08:00 List-Id: 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");