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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,9fa5063fbdc75ae4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-15 07:22:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!priapus.visi.com!news-out.visi.com!petbe.visi.com!feed.news.qwest.net!namche.sun.com!news1brm.central.sun.com!new-usenet.uk.sun.com!not-for-mail From: Ole-Hjalmar Kristensen Newsgroups: comp.lang.ada Subject: Re: array of strings in a function Date: 15 Oct 2003 16:19:12 +0200 Organization: Sun Microsystems Message-ID: References: NNTP-Posting-Host: khepri06.norway.sun.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: new-usenet.uk.sun.com 1066227553 6146 129.159.112.195 (15 Oct 2003 14:19:13 GMT) X-Complaints-To: usenet@new-usenet.uk.sun.com NNTP-Posting-Date: 15 Oct 2003 14:19:13 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:897 Date: 2003-10-15T14:19:13+00:00 List-Id: You could have an unconstrained array of Unbounded_String as the parameter to your procedure, like this: with Ada.Text_Io; use Ada.Text_Io; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; procedure U is type U_S_A is array(Integer range <>) of Unbounded_String; procedure Print(S : U_S_A) is begin for I in S'Range loop Put_Line(To_String(S(I))); end loop; end Print; X : U_S_A := (To_Unbounded_String("foo"), To_Unbounded_String("bar")); begin Print(X); end U; >>>>> "AM�" == Antonio Mart�nez �lvarez writes: AM�> Hello again. I'm the original poster. AM�> What I want to do is a procedure (sorry, not a function) to do AM�> something like this: AM�> my_AND("Entrada_1", "P2", "Output"); AM�> and with this argument, this function have to write this: AM�> entity my_AND is port( AM�> Entrada_1 : in std_logic; AM�> P2 : in std_logic; AM�> Output : out std:logic; AM�> ); AM�> (This is VHDL code, very similar to Ada95). AM�> In general, I don't know the number of string arguments. An these AM�> strings can be any length. I have tried to do this with AM�> unbounded... but without any nice results ... AM�> Maybe I must use access variables, like in C. I know how to do this in AM�> C, but I'm really interested in do this job into Ada95. I'm writting a AM�> generator of VHDL (parsing, etc ...). AM�> I'll send the answer when it works. But till this moment, and havig AM�> read your posts I haven't found the answer. AM�> Thank you so much. AM�> -- AM�> Antonio Mart�nez -- This page intentionally left blank