comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <ggsub@pragmada.x10hosting.com>
Subject: Re: confusion with string initialization
Date: Sat, 17 Apr 2010 14:30:36 -0700 (PDT)
Date: 2010-04-17T14:30:36-07:00	[thread overview]
Message-ID: <9b6f640b-de49-4104-9eb7-264a930d50a3@y17g2000yqd.googlegroups.com> (raw)
In-Reply-To: ZpWdnRumIodDKFTWnZ2dnUVZ_tudnZ2d@giganews.com

On Apr 17, 6:21 am, brett <u...@compgroups.net/> wrote:
> I'm trying to learn Ada 2005 with GNAT ( Linux) and are having problems with string initialization using the
>
> bs := 20 * " ";  
>
> 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 := Ada.Strings.Fixed."*" (20, " ");

for example.



  parent reply	other threads:[~2010-04-17 21:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-17 13:21 confusion with string initialization brett
2010-04-17 13:06 ` Georg Bauhaus
2010-04-17 17:42 ` 
2010-04-17 19:01 ` J-P. Rosen
2010-04-17 21:30 ` Jeffrey R. Carter [this message]
2010-04-18  2:13 ` brett
2010-04-18 13:36   ` Alex Mentis
2010-04-19 14:54   ` Colin Paul Gloster
2010-04-19 14:12     ` J-P. Rosen
2010-04-19 18:20       ` John B. Matthews
2010-04-19 23:18         ` Adam Beneschan
2010-04-20  3:37           ` John B. Matthews
2010-04-27  9:08       ` Jacob Sparre Andersen
2010-04-28 13:26         ` BrianG
2010-04-19 19:48     ` 
2010-04-19 20:05       ` Warren
2010-04-19 20:06       ` Georg Bauhaus
2010-04-21  1:12 ` brett
replies disabled

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