From: "Beard, Frank" <beardf@spawar.navy.mil>
To: "'comp.lang.ada@ada.eu.org'" <comp.lang.ada@ada.eu.org>
Subject: RE: Natural to String without space? (newbie question)
Date: Thu, 24 May 2001 17:55:23 -0400
Date: 2001-05-24T17:55:23-04:00 [thread overview]
Message-ID: <mailman.990741393.31666.comp.lang.ada@ada.eu.org> (raw)
Well, you learn something new everyday. I didn't know you
could do a rename and default a parameter when the parent
function was not defaulted.
Thanks for the info.
Frank
-----Original Message-----
From: Martin Dowie [mailto:martin.dowie@nospam.baesystems.com]
or,
function Trim (Value : String;
Side : Ada.Strings.Trim_End := Ada.Strings.Both)
return String renames Ada.Strings.Fixed.Trim;
Beard, Frank <beardf@spawar.navy.mil> wrote in message
news:mailman.990658037.12046.comp.lang.ada@ada.eu.org...
> Probably the best way is:
>
> Make your own common function, such as:
>
> with Ada.Strings; use Ada.Srings;
> with Ada.Strings.Fixed; use Ada.Srings.Fixed;
>
> function Trim(the_String : string) return string is
> begin
> return Trim(source => the_String,
> side => both);
> end Trim;
>
>
> Then include it in a context clause, such as:
>
> with Ada.Text_Io;
> with Trim;
>
> procedure Trim_Test is
>
> number : natural := 1234;
>
> begin
>
> Ada.Text_Io.Put_Line(Trim(natural'image(number)));
>
> end Trim_Test;
>
>
> Hope this helps.
> Frank
>
> -----Original Message-----
> From: Tomas Hlavaty [mailto:hlavaty@labe.felk.cvut.cz]
> Sent: Wednesday, May 23, 2001 11:18 AM
> To: comp.lang.ada@ada.eu.org
> Subject: Natural to String without space? (newbie question)
>
>
> Natural'Image returns string with space at the begining. Is there any
> standard way how to get number without this additional character?
>
> Thanks,
>
> Tomas
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada.eu.org
http://ada.eu.org/mailman/listinfo/comp.lang.ada
next reply other threads:[~2001-05-24 21:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-24 21:55 Beard, Frank [this message]
2001-05-25 7:30 ` Natural to String without space? (newbie question) Martin Dowie
2001-05-25 8:30 ` Tomas Hlavaty
2001-05-25 15:05 ` Ehud Lamm
2001-05-28 7:31 ` Martin Dowie
2001-05-25 21:23 ` Ole-Hjalmar Kristensen
-- strict thread matches above, loose matches on Subject: below --
2001-05-23 22:45 Beard, Frank
2001-05-24 7:56 ` Martin Dowie
2001-05-23 15:17 Tomas Hlavaty
2001-05-23 22:37 ` DuckE
2001-05-24 6:33 ` Pascal Obry
2001-05-29 21:04 ` Wes Groleau
2001-05-29 23:00 ` Jeffrey Carter
2001-05-30 7:19 ` Pascal Obry
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox