comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: need a little string hint...
Date: Mon, 28 Feb 2005 17:49:14 GMT
Date: 2005-02-28T17:49:14+00:00	[thread overview]
Message-ID: <uQIUd.7719$MY6.7486@newsread1.news.pas.earthlink.net> (raw)
In-Reply-To: <1109609391.989190.235510@f14g2000cwb.googlegroups.com>

mferracini wrote:

> mhh and how i can trim away the ' '?

Note that they are only ' ' because you initialized Host to all spaces; 
otherwise they would be stack junk.

Because you know they are ' ', you could use Ada.Strings.Fixed.Trim, but 
that's probably overkill for this case. Another way, and one that works 
even if the unused positions contain stack junk, is

Ada.Text_IO.Get_Line (File => Config, Item => Host, Last => Host_Last);
... -- No change to Host_Last
Server.Addr :=
    Addresses (Get_Host_By_Name (Host (Host'First .. Host_Last) ), 1);

-- 
Jeff Carter
"Why don't you bore a hole in yourself and let the sap run out?"
Horse Feathers
49



  parent reply	other threads:[~2005-02-28 17:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2005-02-28 16:51   ` mferracini
2005-02-28 16:59     ` Adrien Plisson
2005-03-01  3:07 ` Steve
replies disabled

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