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-Thread: 103376,c58a5b8372dc24a0 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!y17g2000yqd.googlegroups.com!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: confusion with string initialization Date: Sat, 17 Apr 2010 14:30:36 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9b6f640b-de49-4104-9eb7-264a930d50a3@y17g2000yqd.googlegroups.com> References: NNTP-Posting-Host: 75.243.144.212 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1271539836 2498 127.0.0.1 (17 Apr 2010 21:30:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 17 Apr 2010 21:30:36 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y17g2000yqd.googlegroups.com; posting-host=75.243.144.212; posting-account=yOOUcAoAAABjcyl4BUJf9FM0ne56zA9Q User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100401 Ubuntu/9.10 (karmic) Firefox/3.5.9,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:11018 Date: 2010-04-17T14:30:36-07:00 List-Id: On Apr 17, 6:21=A0am, brett wrote: > I'm trying to learn Ada 2005 with GNAT ( Linux) and are having problems w= ith string initialization using the > > bs :=3D 20 * " "; =A0 > > construct, which always gives an error > > "universal integer expected" You don't really give enough information for us to give definite help. We have no idea what the subtype of Bs is, nor what context clauses you have. GNAT is trying to find a function "*" that takes universal_integer (or a type that it can be implicitly converted to) for its 1st operand, and a string type for its right operand. Apparently no such function is visible, and it's telling you what is needed to match a visible function "*" that it did find. Clearly that msg isn't useful for you. There are such functions defined in the various Ada.Strings.* pkgs. Perhaps you have mentioned one of those in a context clause, but have not made the function directly visible through a renaming, a use clause, or a use type clause. You could either add such direct visibility, or use the function's full name: Bs :=3D Ada.Strings.Fixed."*" (20, " "); for example.